-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
42 lines (39 loc) · 1.11 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
35
36
37
38
39
40
41
42
include:
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate.gitlab-ci.yml'
ref: v17.31.0
stages:
- get-version
- build
- package
- deploy
get-app-version:
stage: get-version
image: alpine:3
script:
- echo -e "APP_VERSION=$(echo -e ${CI_COMMIT_TAG} | sed 's/^.//')" > build.env
artifacts:
reports:
dotenv: build.env
rules:
- if: '$CI_COMMIT_TAG =~ /^[v]\d+.\d+.\d+/'
when: on_success
package-and-push:
stage: package
needs:
- get-app-version
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$DOCKER_REGISTRY\":{\"auth\":\"$(echo -n $DOCKER_REGISTRY_USER:$DOCKER_REGISTRY_PASSWORD | base64)\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/aio.Dockerfile"
--destination "${DOCKER_REGISTRY_IMAGE}:${APP_VERSION}"
--destination "${DOCKER_REGISTRY_IMAGE}:latest"
rules:
- if: '$CI_COMMIT_TAG =~ /^[v]\d+.\d+.\d+/'
when: on_success