-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
49 lines (44 loc) · 1.49 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
variables:
GIT_SUBMODULE_STRATEGY: none
CI_DISPOSABLE_ENVIRONMENT: "true"
image: docker:latest
stages:
- build
- release
- cleanup
before_script:
- mkdir -p ${HOME}/.ssh
- '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts'
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking yes\n\n" > ~/.ssh/config'
- chmod -R 700 ~/.ssh
- ssh-keyscan -H github.com >> ${HOME}/.ssh/known_hosts
- ssh-keyscan -H gl.blockstream.io >> ${HOME}/.ssh/known_hosts
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
build:
stage: build
only:
- staging
- testing
- master
script:
- docker build --build-arg ENV_NAME=$CI_COMMIT_REF_NAME -t glregistry.blockstream.io/liquid/elements-explorer/explorer:$CI_COMMIT_REF_NAME ./docker/explorer/
- docker build --build-arg ENV_NAME=$CI_COMMIT_REF_NAME -t glregistry.blockstream.io/liquid/elements-explorer/daemon:$CI_COMMIT_REF_NAME ./docker/daemon/
release:
stage: release
only:
- staging
- testing
- master
script:
- docker push glregistry.blockstream.io/liquid/elements-explorer/explorer:latest
- docker push glregistry.blockstream.io/liquid/elements-explorer/daemon:latest
cleanup:
stage: cleanup
only:
- staging
- testing
- master
script:
- docker rmi glregistry.blockstream.io/liquid/elements-explorer/explorer:$CI_COMMIT_REF_NAME
- docker rmi glregistry.blockstream.io/liquid/elements-explorer/daemon:$CI_COMMIT_REF_NAME