2021-03-10 04:48:17 +01:00
|
|
|
image:
|
|
|
|
name: gcr.io/kaniko-project/executor:debug
|
|
|
|
entrypoint: [""]
|
2021-02-05 16:53:15 +01:00
|
|
|
|
|
|
|
variables:
|
2021-07-06 20:12:32 +02:00
|
|
|
KANIKO_CACHE_ARGS: "--cache=true --cache-copy-layers=true --cache-ttl=24h"
|
|
|
|
MR_IMAGE_TAG: $CI_REGISTRY_IMAGE/mergerequest/$APP_NAME:$CI_COMMIT_SHORT_SHA
|
2021-02-05 16:53:15 +01:00
|
|
|
|
|
|
|
.py_build_merge_request:
|
|
|
|
stage: build
|
|
|
|
variables:
|
2021-05-25 18:22:26 +02:00
|
|
|
CI_DEBUG_TRACE: "true"
|
2021-07-06 19:02:56 +02:00
|
|
|
IMAGE_TAG: $CI_REGISTRY_IMAGE/mergerequest/$APP_NAME:$CI_COMMIT_SHORT_SHA
|
2021-07-06 19:30:12 +02:00
|
|
|
CONTEXT: $CI_PROJECT_DIR/apps/
|
2021-02-05 16:53:15 +01:00
|
|
|
script:
|
2021-03-10 04:48:17 +01:00
|
|
|
- mkdir -p /kaniko/.docker
|
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > "/kaniko/.docker/config.json"
|
2021-07-06 19:06:11 +02:00
|
|
|
- /kaniko/executor --context $CONTEXT --dockerfile $DOCKERFILE_PATH $KANIKO_CACHE_ARGS --cache-repo $CI_REGISTRY_IMAGE --destination $IMAGE_TAG
|
2021-02-05 16:53:15 +01:00
|
|
|
|
2021-07-06 19:15:24 +02:00
|
|
|
.py_build_target_dev:
|
|
|
|
stage: build
|
|
|
|
variables:
|
2021-07-07 09:45:21 +02:00
|
|
|
IMAGE_TAG_BASE: $CI_REGISTRY_IMAGE/$APP_NAME:mr-unittest-$CI_COMMIT_SHORT_SHA
|
2021-07-06 19:15:24 +02:00
|
|
|
script:
|
|
|
|
- mkdir -p /kaniko/.docker
|
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > "/kaniko/.docker/config.json"
|
2021-07-06 20:12:32 +02:00
|
|
|
- /kaniko/executor --context $CONTEXT --dockerfile $DOCKERFILE_PATH $KANIKO_CACHE_ARGS --cache-repo $CI_REGISTRY_IMAGE --target dev --tarPath $APP_NAME-test-image.tar --destination $MR_IMAGE_TAG
|
2021-05-25 18:22:26 +02:00
|
|
|
|
2021-02-05 16:53:15 +01:00
|
|
|
.py_build_push:
|
2021-03-10 04:48:17 +01:00
|
|
|
stage: build
|
|
|
|
variables:
|
|
|
|
IMAGE_TAG_BASE: $CI_REGISTRY_IMAGE/$APP_NAME:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
|
|
|
|
LATEST_TAG: $CI_REGISTRY_IMAGE/$APP_NAME:latest
|
|
|
|
script:
|
2021-04-19 19:56:19 +02:00
|
|
|
- export IMAGE_TAG="$IMAGE_TAG_BASE-$(date +%s)"
|
2021-03-10 04:48:17 +01:00
|
|
|
- mkdir -p /kaniko/.docker
|
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > "/kaniko/.docker/config.json"
|
2021-03-15 15:21:39 +01:00
|
|
|
# - /kaniko/executor --context $CONTEXT --dockerfile $DOCKERFILE_PATH $KANIKO_CACHE_ARGS --destination $IMAGE_TAG
|
2021-03-15 15:31:48 +01:00
|
|
|
- /kaniko/executor --context $CONTEXT --dockerfile $DOCKERFILE_PATH $KANIKO_CACHE_ARGS --destination $IMAGE_TAG --destination $CI_REGISTRY_IMAGE/$APP_NAME:latest
|
2021-02-05 16:53:15 +01:00
|
|
|
|
2021-01-24 21:16:22 +01:00
|
|
|
|
|
|
|
|