Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does Atlantis support git clone with ssh? #1635

Open
amna-ali opened this issue Jun 16, 2021 · 4 comments
Open

Does Atlantis support git clone with ssh? #1635

amna-ali opened this issue Jun 16, 2021 · 4 comments
Labels

Comments

@amna-ali
Copy link

Atlantis uses HTTPS to clone git repos. does Atlantis support ssh? i have installed Atlantis on my own infra (EC2) and use this command to start Atlantis
./atlantis server --atlantis-url="http://xxxxxxxxxxxx:4141" --gitlab-user="my_user" --gitlab-token="xxxxxxxxxxx" --gitlab-webhook-secret="xxxxxxxxxxxxxxxxxxx" --gitlab-hostname="my gitlab server(gitlab enterprise)" --repo-allowlist="gitlab_url/operations/terraform/xxxxxxxxxx"

when I run PR on my Enterprise GitLab, Atlantis starts to run the TF plan but I got this error message
running git clone --branch ec22222222 --depth=1 --single-branch https://my_user:<redacted>@gitlab_url/operations/terraform/xxxxxxxxxxxx/home/atlantis/.atlantis/repos/operations/terraform/xxxxxxx/30/default: Cloning into '/home/atlantis/.atlantis/repos/operations/terraform/xxxxxxxxxx/30/default'... remote: Git access over HTTP is not allowed fatal: unable to access 'https://gitlab_url/operations/terraform/xxxxxxxxxxx/': The requested URL returned error: 403 : exit status 128

I tried the workaround in this link but it doesn't work
Also, I tried to add --write-git-creds into Atlantis start-up command and added ssh (ssh://git@gitlab_url:9922) link in .git-credentials but doesn't work too.

@dgokcin
Copy link

dgokcin commented Apr 4, 2022

have you ever figured this out @amna-ali ?

@amna-ali
Copy link
Author

amna-ali commented Apr 4, 2022

@dgokcin nope, it doesn't support in Atlantis so i enabled https in Gitlab

@dgokcin
Copy link

dgokcin commented Apr 4, 2022

@amna-ali so I am using atlantis with a github app. my atlantis instance has ATLANTIS_GH_APP_KEY and ATLANTIS_GH_APP_ID environment variables. I see in the logs that atlantis is having problems with my pre_workflow_hooks which tries updating a submodule(the repo where I have common Infrastructure resources)

Here is my log output. Any idea if this is related with your problem or not?

msg : Error running pre-workflow hooks exit status 1: running "git submodule update --init --recursive" in "/home/atlantis/.atlantis/repos/MyOrg/MyRepo/26/default":Submodule 'terragrunt/common' (git@github.com:MyOrg/CommonInfrastructure.git) registered for path 'terragrunt/common'Cloning into '/home/atlantis/.atlantis/repos/MyOrg/MyRepo/26/default/terragrunt/common'...Host key verification failed.fatal: Could not read from remote repository.

@y2abba
Copy link

y2abba commented Mar 16, 2023

@dgokcin did you figure out your pre-workflow hook problem?

@dosubot dosubot bot added the Stale label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants