use common CI template
This commit is contained in:
parent
fd98d6d117
commit
f0e0f7d5f5
124
.gitlab-ci.yml
124
.gitlab-ci.yml
|
@ -2,115 +2,25 @@ stages:
|
||||||
- lint
|
- lint
|
||||||
- build
|
- build
|
||||||
|
|
||||||
.build-master:
|
variables:
|
||||||
image:
|
ESLINT_PATHS: js plugins
|
||||||
name: ${CI_DOCKER_IMAGE}
|
|
||||||
stage: build
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "web"
|
|
||||||
changes:
|
|
||||||
- '**/*.php'
|
|
||||||
- '**/*.js'
|
|
||||||
- '.docker/**/*'
|
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
||||||
when: manual
|
|
||||||
before_script:
|
|
||||||
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
|
|
||||||
- docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_TOKEN}
|
|
||||||
|
|
||||||
- docker run --privileged --rm registry.fakecake.org/docker.io/tonistiigi/binfmt --install all
|
include:
|
||||||
- docker buildx create --name mp-builder --driver docker-container --bootstrap --use
|
- project: 'ci/ci-templates'
|
||||||
|
ref: master
|
||||||
script:
|
file: .ci-build-docker.yml
|
||||||
- BUILD_TIMESTAMP=$(date -d $(echo ${CI_COMMIT_TIMESTAMP} | cut -b 1-10) +%y.%m)
|
- project: 'ci/ci-templates'
|
||||||
|
ref: master
|
||||||
- docker buildx build
|
file: .ci-lint-common.yml
|
||||||
--push
|
|
||||||
--platform linux/amd64,linux/arm64,linux/arm/v7
|
|
||||||
--tag ${CI_REGISTRY}/cthulhoo/${CI_JOB_NAME}:${BUILD_TIMESTAMP}-${CI_COMMIT_SHORT_SHA}
|
|
||||||
--tag ${CI_REGISTRY}/cthulhoo/${CI_JOB_NAME}:latest
|
|
||||||
--tag cthulhoo/${CI_JOB_NAME}:${BUILD_TIMESTAMP}-${CI_COMMIT_SHORT_SHA}
|
|
||||||
--tag cthulhoo/${CI_JOB_NAME}:latest
|
|
||||||
--build-context app-src=.
|
|
||||||
--cache-from type=registry,ref=${CI_REGISTRY}/cthulhoo/${CI_JOB_NAME}:latest
|
|
||||||
--cache-to type=inline
|
|
||||||
${BUILD_CONTEXT}
|
|
||||||
|
|
||||||
# note: CI_REGISTRY, etc. variables are privileged
|
|
||||||
#
|
|
||||||
# .build-branch:
|
|
||||||
# image:
|
|
||||||
# name: ${CI_DOCKER_IMAGE}
|
|
||||||
# stage: build
|
|
||||||
# rules:
|
|
||||||
# - if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "web"
|
|
||||||
# changes:
|
|
||||||
# - '**/*.php'
|
|
||||||
# - '**/*.js'
|
|
||||||
# - '.docker/**/*'
|
|
||||||
# - if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
|
|
||||||
# when: manual
|
|
||||||
# before_script:
|
|
||||||
# - docker buildx create --name mp-builder --driver docker-container --bootstrap --use
|
|
||||||
# - CONTAINER_NAME=$(echo ${CI_JOB_NAME} | sed 's/branch://')
|
|
||||||
# script:
|
|
||||||
# - docker buildx build
|
|
||||||
# --push
|
|
||||||
# --platform linux/amd64
|
|
||||||
# --tag ${CI_REGISTRY}/cthulhoo/$CONTAINER_NAME:${CI_COMMIT_BRANCH}-${CI_COMMIT_SHORT_SHA}
|
|
||||||
# --tag ${CI_REGISTRY}/cthulhoo/$CONTAINER_NAME:${CI_COMMIT_BRANCH}
|
|
||||||
# --build-context app-src=.
|
|
||||||
# --cache-from type=registry,ref=${CI_REGISTRY}/cthulhoo/$CONTAINER_NAME:${CI_COMMIT_BRANCH}
|
|
||||||
# --cache-to type=inline
|
|
||||||
# ${BUILD_CONTEXT}
|
|
||||||
|
|
||||||
phpunit:
|
phpunit:
|
||||||
image:
|
extends: .phpunit
|
||||||
name: ${CI_DOCKER_IMAGE}
|
|
||||||
stage: lint
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE != "web"
|
|
||||||
changes:
|
|
||||||
- '**/*.php'
|
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
||||||
- if: $CI_COMMIT_BRANCH
|
|
||||||
when: manual
|
|
||||||
allow_failure: true
|
|
||||||
script:
|
|
||||||
- php81 ./vendor/bin/phpunit
|
|
||||||
|
|
||||||
eslint:
|
eslint:
|
||||||
image:
|
extends: .phpunit
|
||||||
name: ${CI_DOCKER_IMAGE}
|
|
||||||
stage: lint
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE != "web"
|
|
||||||
changes:
|
|
||||||
- '**/*.js'
|
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
||||||
- if: $CI_COMMIT_BRANCH
|
|
||||||
when: manual
|
|
||||||
allow_failure: true
|
|
||||||
script:
|
|
||||||
- npm install
|
|
||||||
- npx eslint js plugins
|
|
||||||
|
|
||||||
phpstan:
|
phpstan:
|
||||||
image:
|
extends: .phpstan
|
||||||
name: ${CI_DOCKER_IMAGE}
|
|
||||||
needs:
|
|
||||||
- phpunit
|
|
||||||
stage: lint
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE != "web"
|
|
||||||
changes:
|
|
||||||
- '**/*.php'
|
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
||||||
- if: $CI_COMMIT_BRANCH
|
|
||||||
when: manual
|
|
||||||
allow_failure: true
|
|
||||||
script:
|
|
||||||
- php81 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G
|
|
||||||
|
|
||||||
ttrss-web-nginx:
|
ttrss-web-nginx:
|
||||||
extends: .build-master
|
extends: .build-master
|
||||||
|
@ -122,16 +32,6 @@ ttrss-fpm-pgsql-static:
|
||||||
variables:
|
variables:
|
||||||
BUILD_CONTEXT: ${CI_PROJECT_DIR}/.docker/app
|
BUILD_CONTEXT: ${CI_PROJECT_DIR}/.docker/app
|
||||||
|
|
||||||
# branch:ttrss-web-nginx:
|
|
||||||
# extends: .build-branch
|
|
||||||
# variables:
|
|
||||||
# BUILD_CONTEXT: ${CI_PROJECT_DIR}/.docker/web-nginx
|
|
||||||
|
|
||||||
# branch:ttrss-fpm-pgsql-static:
|
|
||||||
# extends: .build-branch
|
|
||||||
# variables:
|
|
||||||
# BUILD_CONTEXT: ${CI_PROJECT_DIR}/.docker/app
|
|
||||||
|
|
||||||
phpdoc:
|
phpdoc:
|
||||||
image:
|
image:
|
||||||
name: ${CI_DOCKER_IMAGE}
|
name: ${CI_DOCKER_IMAGE}
|
||||||
|
|
Loading…
Reference in New Issue