-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
44 lines (38 loc) · 984 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
stages:
- build
- tag
- push
workflow:
rules:
- if: $CI_COMMIT_TAG
when: always
- when: never
build:
stage: build
before_script:
- export VERSION=$(jq -r '.version?' ./package.json)
- mkdir -p .ssh && cp $GIT_CUSTOM_CONFIG .ssh/config && cp ~/.ssh/id_rsa .ssh/id_rsa
script: /usr/bin/docker build -t "$NEXUS/lforms/flowsheet-lhc:$VERSION" --build-arg NODE_ENV=production .
only:
- master
- tags
tags: [cmd]
tag:
stage: tag
before_script:
- export VERSION=$(jq -r '.version?' ./package.json)
script: /usr/bin/docker tag $NEXUS/lforms/flowsheet-lhc:$VERSION $NEXUS/lforms/flowsheet-lhc:latest
only:
- master
- tags
tags: [cmd]
push:
stage: push
before_script:
- export VERSION=$(jq -r '.version?' ./package.json)
- /usr/bin/docker login $NEXUS -u $NEXUS_USER -p $NEXUS_PASSWORD
script: /usr/bin/docker push $NEXUS/lforms/flowsheet-lhc:$VERSION
only:
- master
- tags
tags: [cmd]