diff options
author | Ben Brown <ben.brown@codethink.co.uk> | 2017-09-06 17:44:38 +0100 |
---|---|---|
committer | Ben Brown <ben.brown@codethink.co.uk> | 2017-09-06 21:49:46 +0100 |
commit | f7d9c4b585172f2f67d64f272e08122bbc5aec9c (patch) | |
tree | e2cae498367667f2084d8120ced4bb21714393ec /.gitlab-ci.yml | |
parent | a6b70c8bd33e48cd00da01d6b5f0c80d9bb2f997 (diff) | |
download | definitions-f7d9c4b585172f2f67d64f272e08122bbc5aec9c.tar.gz |
Continue build on missing keybenbrown/no-key-error
We don't want to error out here, otherwise builds will only pass on
protected branches.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 06c6286e..f1070f4f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,17 +24,19 @@ before_script: # Store cache in the shared Docker volume - export XDG_CACHE_HOME=/cache + # Create ~/.ssh for storing keys + - mkdir -p ~/.ssh + # Private key stored as a protected variable that allows pushing to # ostree@ostree.baserock.org - | if [ -z "$baserock_ostree_cache_private_key" ]; then echo >&2 "Private key for ostree.baserock.org is not available." - exit 1 + else + echo "$baserock_ostree_cache_private_key" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub fi - mkdir -p ~/.ssh - echo "$baserock_ostree_cache_private_key" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub # Trust the host key of the cache server. - ssh-keyscan -p 22200 ostree.baserock.org >> ~/.ssh/known_hosts @@ -44,8 +46,10 @@ before_script: mkdir -p ~/.config echo "artifacts:" > ~/.config/buildstream.conf echo " pull-url: https://ostree.baserock.org/cache/" >> ~/.config/buildstream.conf - echo " push-url: ostree@ostree.baserock.org:cache" >> ~/.config/buildstream.conf - echo " push-port: 22200" >> ~/.config/buildstream.conf + if [ -n "$baserock_ostree_cache_private_key" ]; then + echo " push-url: ostree@ostree.baserock.org:cache" >> ~/.config/buildstream.conf + echo " push-port: 22200" >> ~/.config/buildstream.conf + fi cat ~/.config/buildstream.conf # Install and configure YBD |