diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57a3d069..d17fbda3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -131,6 +131,10 @@ release: dependencies: - php-dependencies - js-dependencies + artifacts: + paths: + - castopod + - CP_VERSION.env only: - main - beta @@ -163,5 +167,8 @@ docker: only: refs: - develop + - main + - beta + - alpha variables: - $CI_PROJECT_NAMESPACE == "adaures" diff --git a/docker/production/.gitlab-ci.yml b/docker/production/.gitlab-ci.yml index 5c9e8b22..8297344e 100644 --- a/docker/production/.gitlab-ci.yml +++ b/docker/production/.gitlab-ci.yml @@ -18,3 +18,38 @@ docker-build-rolling: only: refs: - develop + +docker-build-main-release: + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - cp ${DOCKER_HUB_CONFIG} /kaniko/.docker/config.json + - export CP_VERSION=(cat CP_VERSION.env) + - /kaniko/executor --context . --dockerfile docker/production/web-server/Dockerfile --destination ${DOCKER_IMAGE_WEB_SERVER}:${CP_VERSION} --destination ${DOCKER_IMAGE_WEB_SERVER}:latest + - /kaniko/executor --context . --dockerfile docker/production/app/Dockerfile --destination ${DOCKER_IMAGE_APP}:${CP_VERSION} --destination ${DOCKER_IMAGE_APP}:latest + needs: + - pipeline: $PARENT_PIPELINE_ID + job: release + only: + refs: + - main + +docker-build-alpha-beta-release: + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - cp ${DOCKER_HUB_CONFIG} /kaniko/.docker/config.json + - export CP_VERSION=(cat CP_VERSION.env) + - /kaniko/executor --context . --dockerfile docker/production/web-server/Dockerfile --destination ${DOCKER_IMAGE_WEB_SERVER}:${CP_VERSION} + - /kaniko/executor --context . --dockerfile docker/production/app/Dockerfile --destination ${DOCKER_IMAGE_APP}:${CP_VERSION} + needs: + - pipeline: $PARENT_PIPELINE_ID + job: release + only: + refs: + - alpha + - beta diff --git a/scripts/bundle.sh b/scripts/bundle.sh index baf9a84f..95e31c48 100644 --- a/scripts/bundle.sh +++ b/scripts/bundle.sh @@ -11,6 +11,9 @@ echo "$( jq '.version = "'$COMPOSER_VERSION'"' composer.json )" > composer.json # replace CP_VERSION constant in app/config/constants sed -i "s/^defined('CP_VERSION').*/defined('CP_VERSION') || define('CP_VERSION', '$VERSION');/" ./app/Config/Constants.php +# fill CP_VERSION.env for docker build +echo "$VERSION" > ./CP_VERSION.env + # install wget to download archives apt-get install wget