Skip to content

Instantly share code, notes, and snippets.

@BirgitPohl
Last active October 3, 2022 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BirgitPohl/7af71194f1f0045fec7004353abab0bc to your computer and use it in GitHub Desktop.
Save BirgitPohl/7af71194f1f0045fec7004353abab0bc to your computer and use it in GitHub Desktop.
Whitlabel Deployment
# It assumes you have templates setup and to be recognized.
# the extends command takes the extension of this template Yaml file.
# A Kaniko example:
.docker-build:
stage: my-stage
only:
- master
image:
name: gcr.io/kaniko-project/executor:debug
variables:
KANIKO_ARGS: --context ${CI_PROJECT_DIR}
when: manual #important to have, to be able to choose which brand is to be build
before_script:
- echo $PROJECT_VERSION
- echo $THEME
script:
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor ${KANIKO_ARGS} --build-arg BRAND="${BRAND}" --build-arg BUILD_MODE="${ENVIRONMENT}" --destination ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_PROJECT_NAME}:latest
include:
- local: ".gitlab/.common-template.yml"
Build Image Brand1:
variables:
brand: brand1
extends: .docker-build
Build Image Brand2:
variables:
brand: brand2
extends: .docker-build
Docker Tag:
# Tag the docker
Deploy:
# Deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment