-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
55 lines (47 loc) · 1.23 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
image: docker-registry:4567/docker-images/docker-bot:latest
variables:
GIT_SSL_NO_VERIFY: "true" # FIXME
before_script:
- apk add --no-cache python3
- ls -la
- mkdir -p /opt/staging
- cp staging/* /opt/staging
- chmod +x /opt/staging/*
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- bash -c "ssh-add <(echo '$SECBOT_KEY')"
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
# - echo $SECBOT_VAULT > /tmp/.vault_pass
stages:
- deploy
- staging
- update
deploy_secbot:
stage: deploy
script:
- pwd
- cd deploy/
- ansible-playbook -i inventory secbot-deploy.yml
# - ansible-playbook -i inventory secbot-deploy.yml --vault-password-file /tmp/.vault_pass
only:
- /^deploy.*$/
staging_tests:
stage: staging
script:
- printf Running staging tests
- cd staging/
- pwd
- python3 staging.py
only:
- master
update_secbot:
stage: update
script:
- pwd
- cd deploy/
- ansible-playbook -i inventory secbot-update.yml
# assumes deploy stage was run before and vault file was update on secbot (needed for secbot.py and plugins)
#
only:
- master