Gitlab CI can't fetch repo because keep asking for keychain password
Asked Answered
R

1

10

I have project on company Gitlab. Project is for iOS platform so my node for building project is Mac Mini with OS Sierra.

Runner works great - connecting etc works. But when I try to run pipeline I get message on node like on picture. This alert appear when gitlab runner wants to checkout code.

I checked in KeychainAccess that git-credential-osxkeychain app have access to password for gitlab on login keychain.

How to fix that and disable dialog for keychain password?

config.toml file:

concurrent = 1
check_interval = 0

[[runners]]
name = "Mac mini runner"
url = "URLtoMyGitLab"
token = "token"
executor = "shell"
[runners.cache]

git-credential-osxkeychain

Roane answered 12/1, 2017 at 8:22 Comment(6)
You get a popup window when trying to run a pipeline? I'm pretty sure you need to provide more info as your local popups have nothing to do with gitlab and it's runners.Blossom
Yes I get popup on my mac mini node when gitlab runner tried to checkout code. Then when I provide password to my keychain it clone repo and run other scrips from config file. What additional info can be useful?Roane
Well, the runner configuration. What executor you are running etc.Blossom
In previous message I attached my runner configuration (without token and url). I am using shell as executorRoane
I believe if you switch to docker executor it shouldn't be a problem.Blossom
Unfortunately I can't because iOS project requires Xcode tools for building which is not available on any docker image.Roane
J
2

For me the solution for this was to configure git, to use keychain in the project root.

- git config --global credential.helper osxkeychain

along with unlocking the keychain in before_script:

- security unlock-keychain -p $PASSWORD /Users/[MASKED]/Library/Keychains/login.keychain-db
- security set-keychain-settings -t 3600 -l /Users/[MASKED]/Library/Keychains/login.keychain-db
Joachim answered 15/11, 2019 at 8:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.