-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
34 lines (34 loc) · 1.29 KB
/
.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
23
24
25
26
27
28
29
30
31
32
33
34
docker-build-images:
stage: build
parallel:
matrix:
- DOCKERFILE: packages/kontinuous/Dockerfile
DESTINATION: ""
- DOCKERFILE: packages/webhook/Dockerfile
DESTINATION: "/webhook"
- DOCKERFILE: packages/degit/Dockerfile
DESTINATION: "/degit"
- DOCKERFILE: packages/wait-needs/Dockerfile
DESTINATION: "/wait-needs"
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: ["/busybox/sh","-c"]
script:
- |
mkdir -p /kaniko/.docker
echo "{\"auths\":{\"$HARBOR\":{\"username\":\"$HARBOR_USER\",\"password\":\"$HARBOR_PASSWORD\"}}}" > /kaniko/.docker/config.json
if [ -n "$CI_COMMIT_TAG" ]; then
MAIN_VERSION=${CI_COMMIT_TAG%%.*}
DESTINATION_ADD=--destination="${HARBOR}/${CI_PROJECT_PATH}${DESTINATION}:${MAIN_VERSION}"
fi
/kaniko/executor \
--context="dir://${CI_PROJECT_DIR}" \
--dockerfile="${CI_PROJECT_DIR}/${DOCKERFILE}" \
--destination="${HARBOR}/${CI_PROJECT_PATH}${DESTINATION}:${CI_COMMIT_TAG:-$CI_COMMIT_REF_NAME}" \
--destination="${HARBOR}/${CI_PROJECT_PATH}${DESTINATION}:latest" \
$DESTINATION_ADD \
--cache=true \
--snapshotMode=time \
--use-new-run
rules:
- if: $CI_COMMIT_REF_NAME == 'master' || $CI_COMMIT_TAG