-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
23 lines (20 loc) · 931 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
stages: ['build'] # , 'test', 'deploy']
variables:
GOOGLE_MAPS_API_KEY: $GOOGLE_MAPS_API_KEY
JOB_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_JOB_NAME-$CI_JOB_ID
COMMIT_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA
BRANCH_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
DOCKER_AUTH_CONFIG: "{\"auths\":{\"registry.gitlab.com\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}"
build:
image:
name: gcr.io/kaniko-project/debug:769
entrypoint: [""]
stage: build
before_script:
- echo $BRANCH_TAG
- echo $JOB_TAG
- echo $COMMIT_TAG
- echo $CI_PROJECT_DIR
script:
- echo $DOCKER_AUTH_CONFIG > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --build-arg GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $COMMIT_TAG --destination $BRANCH_TAG --destination $JOB_TAG