-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
55 lines (50 loc) · 1.12 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
43
44
45
46
47
48
49
50
51
52
53
54
55
image: node:10
stages:
- test
- build-test
- build
- autodeploy
test:
stage: test
script:
- npm install
- NODE_ENV=ci npm run test
tags:
- docker
build-test:
stage: build-test
script:
- npm install --only=production
- npm run tsc
tags:
- docker
except:
- develop
docker build:
image: docker:stable
stage: build
script:
- docker info
- docker build . -t dmsc/duo-backend
- echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USER" --password-stdin
- docker push dmsc/duo-backend
tags:
- docker
only:
- develop
autodeploy:
image: ubuntu:latest
stage: autodeploy
script:
- echo $CI_COMMIT_SHA
- apt-get update -qq
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY_GEN")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- until ssh [email protected] "/home/jekabskarklins/duo-kubernetes/backend/autodeploy.sh dev"; do sleep 5; done
tags:
- dind
only:
- develop