diff options
author | Hans-Peter Oeri <hp@oeri.ch> | 2018-10-25 13:40:10 +0200 |
---|---|---|
committer | Hans-Peter Oeri <hp@oeri.ch> | 2018-10-25 13:40:10 +0200 |
commit | 928baa83e47a11d765493af38307d247148b0a2e (patch) | |
tree | 3f5071d9f25b89b311e09a20b22b9c5a7b225d27 | |
parent | ff89112e87a34156fd0d4a10a10fd43b6f525cbd (diff) |
autodeploy
-rw-r--r-- | .gitlab-ci.yml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..022ba59 --- /dev/null +++ b/.gitlab-ci.yml | |||
@@ -0,0 +1,28 @@ | |||
1 | image: vorakl/alpine-pelican | ||
2 | |||
3 | stages: | ||
4 | - build | ||
5 | - deploy | ||
6 | |||
7 | stage_build: | ||
8 | stage: build | ||
9 | artifacts: | ||
10 | paths: | ||
11 | - output/ | ||
12 | script: | ||
13 | - pelican -v | ||
14 | |||
15 | stage_deploy: | ||
16 | stage: deploy | ||
17 | only: | ||
18 | - master | ||
19 | dependencies: | ||
20 | - stage_build | ||
21 | script: | ||
22 | - apk update | ||
23 | - apk add rsync openssh | ||
24 | - mkdir -p ~/.ssh | ||
25 | - eval $(ssh-agent -s) | ||
26 | - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' | ||
27 | - ssh-add <(echo "$DEPLOY_KEY") | ||
28 | - rsync -Pvr output/ "$DEPLOY_TARGET" | ||