-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
66 lines (56 loc) · 1.48 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
56
57
58
59
60
61
62
63
64
65
66
image: docker:stable
services:
- docker:dind
before_script:
- if [ -x "$(command -v docker)" ]; then docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY; fi
- apk add --no-cache make
stages:
- test
- build
- deploy
- post-deploy
test:
stage: test
script:
- echo "Tests passed O:-)"
build:prod:
stage: build
script:
- docker run --rm -w /srv -v `pwd`:/srv node:10.5-alpine sh -c "apk add --no-cache git && yarn install --frozen-lockfile && npm run-script slides"
- docker pull $CI_REGISTRY/mroca/rtfm-rapid-team-formation-method:${CI_COMMIT_REF_NAME} || true
- docker build -t $CI_REGISTRY/mroca/rtfm-rapid-team-formation-method:${CI_COMMIT_REF_NAME} .
- docker push $CI_REGISTRY/mroca/rtfm-rapid-team-formation-method:${CI_COMMIT_REF_NAME}
only:
- develop
- master
- tags
deploy:uat:
stage: deploy
script:
- echo "Deploying uat..."
only:
- develop
deploy:snapshot:
stage: deploy
before_script:
- apk add --no-cache openssh-client
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
script:
- echo "Deploying snapshot..."
- ssh -A -o StrictHostKeyChecking=no "$SSH_SNAPSHOT_SERVER" "cd mroca-ami && ./update.sh"
only:
- master
deploy:prod:
stage: deploy
script:
- echo "Deploying prod..."
only:
- tags
post-deploy:prod:
stage: post-deploy
script:
- echo "Pushing queue messages..."
only:
- tags