mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-06 18:31:05 +00:00
build(docker): add build for tagged versions on main, beta and alpha
This commit is contained in:
parent
c4a07c29f1
commit
029804b9f8
@ -131,6 +131,10 @@ release:
|
|||||||
dependencies:
|
dependencies:
|
||||||
- php-dependencies
|
- php-dependencies
|
||||||
- js-dependencies
|
- js-dependencies
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- castopod
|
||||||
|
- CP_VERSION.env
|
||||||
only:
|
only:
|
||||||
- main
|
- main
|
||||||
- beta
|
- beta
|
||||||
@ -163,5 +167,8 @@ docker:
|
|||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- develop
|
- develop
|
||||||
|
- main
|
||||||
|
- beta
|
||||||
|
- alpha
|
||||||
variables:
|
variables:
|
||||||
- $CI_PROJECT_NAMESPACE == "adaures"
|
- $CI_PROJECT_NAMESPACE == "adaures"
|
||||||
|
@ -18,3 +18,38 @@ docker-build-rolling:
|
|||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- develop
|
- 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
|
||||||
|
@ -11,6 +11,9 @@ echo "$( jq '.version = "'$COMPOSER_VERSION'"' composer.json )" > composer.json
|
|||||||
# replace CP_VERSION constant in app/config/constants
|
# 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
|
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
|
# install wget to download archives
|
||||||
apt-get install wget
|
apt-get install wget
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user