stages: - build - release - deploy include: - project: 'infrastructure/ci-scripts' file: 'build-docker-image.yml' - project: 'infrastructure/ci-scripts' file: 'release-docker-image.yml' - project: 'infrastructure/ci-scripts' file: 'deploy-kustomize.yml' build: extends: .build_image only: - main release: extends: .release_image script: - docker pull "$DOCKER_IMAGE_SOURCE_TAG" - docker tag "$DOCKER_IMAGE_SOURCE_TAG" "$DOCKER_IMAGE_TARGET_TAG" - docker push "$DOCKER_IMAGE_TARGET_TAG" - docker login --username yureien --password "$DOCKERHUB_PASSWORD" docker.io - docker tag "$DOCKER_IMAGE_SOURCE_TAG" index.docker.io/yureien/yabin:$CI_COMMIT_SHORT_SHA - docker push index.docker.io/yureien/yabin:$CI_COMMIT_SHORT_SHA - docker tag index.docker.io/yureien/yabin:$CI_COMMIT_SHORT_SHA index.docker.io/yureien/yabin:latest - docker push index.docker.io/yureien/yabin:latest only: - main environment: name: prod deploy: extends: .deploy_kustomize variables: KUSTOMIZE_OVERLAY: k8s KUBERNETES_NAMESPACE: default only: - main environment: name: prod