Skip to content
Snippets Groups Projects
Commit 23638e07 authored by Nico's avatar Nico
Browse files

gitlab-ci: start the SSH agent again in after_script

The git push in after_script didn't succeed because of failing
authentication. As the authentication succeeds in before_script, it is
likely the SSH agent from before_script doesn't run in after_script.
Likely because a new shell is spawned. Hence, start it again in
after_script.
parent 6f3df299
No related branches found
No related tags found
No related merge requests found
Pipeline #1074 canceled
...@@ -25,7 +25,16 @@ default: ...@@ -25,7 +25,16 @@ default:
- rm -rf gluon/openwrt/dl && mkdir -p gluon/openwrt && ln -s ../../ffs-openwrt-dl-cache gluon/openwrt/dl - rm -rf gluon/openwrt/dl && mkdir -p gluon/openwrt && ln -s ../../ffs-openwrt-dl-cache gluon/openwrt/dl
- rm -rf gluon/openwrt/staging_dir && mkdir -p staging_dir && ln -s ../../staging_dir gluon/openwrt/staging_dir - rm -rf gluon/openwrt/staging_dir && mkdir -p staging_dir && ln -s ../../staging_dir gluon/openwrt/staging_dir
after_script: after_script:
- cd gluon/openwrt/dl && git add . && git commit -m "update DL cache" && git push || true # we need to start the SSH agent again because it doesn't seem to stay running
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$GIT_SSH_PRIV_KEY")
- git config --global user.email "firmware@freifunk-stuttgart.de"
- git config --global user.name "FFS Buildbot"
- mkdir -p ~/.ssh
- cat gitlab-known-hosts >> ~/.ssh/known_hosts
- cd gluon/openwrt/dl && git add . && git commit -m "update DL cache" || true
- git push || true
generate_date: generate_date:
stage: generate_date stage: generate_date
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment