-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
41 lines (37 loc) · 1.64 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
default:
interruptible: false
stages:
- tag
- publish
- deploy
# tag release
tag:
image: harbor.containers.wurnet.nl/proxy-cache/library/node:19.7-buster-slim
stage: tag
before_script:
- apt-get update && apt-get install -y --no-install-recommends git-core ca-certificates
- npm install -g semantic-release @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/gitlab @semantic-release/git @semantic-release/npm @semantic-release/release-notes-generator conventional-changelog conventional-changelog-conventionalcommits
script:
- semantic-release
when: on_success
only:
- main
except:
refs:
- tags
variables:
- $CI_COMMIT_TITLE =~ /^RELEASE:.+$/
# build a new container
build:
stage: publish
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
when: on_success
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$HARBOR_REGISTRY\":{\"username\":\"$HARBOR_USER\",\"password\":\"$HARBOR_PASSWORD\"}}}" > /kaniko/.docker/config.json
- echo "build; $CI_COMMIT_REF_NAME:$CI_COMMIT_TAG@$CI_COMMIT_SHORT_SHA"
- if [ -z $CI_COMMIT_TAG ]; then /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $HARBOR_REGISTRY/$HARBOR_PROJECT/pygeodatacrawler:latest --destination $HARBOR_REGISTRY/$HARBOR_PROJECT/pygeodatacrawler:$CI_COMMIT_SHORT_SHA; else /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $HARBOR_REGISTRY/$HARBOR_PROJECT/pygeodatacrawler:$CI_COMMIT_TAG --destination $HARBOR_REGISTRY/$HARBOR_PROJECT/pygeodatacrawler:latest; fi
only:
- tags