From b32a8ec4b31a6f49434278cef9870340952d1141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Fri, 18 Jan 2019 15:36:39 +0100 Subject: [PATCH] Workaround trap not executed in gitlab-ci --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48a42ec..9c815c0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,11 @@ commitpkg: stage: deploy script: - eval $(ssh-agent -s) - - trap 'kill $SSH_AGENT_PID' 0 + # - trap "kill $SSH_AGENT_PID" 0 + # trap is broken in gitlab runner, see: + # https://gitlab.com/gitlab-org/gitlab-runner/issues/3009 + # use a workaournd with sleep and kill: + - sleep 300 && kill "$SSH_AGENT_PID" & disown - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - seblu-push only: -- GitLab