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

Working with private repos #9

Open
jeffochoa opened this issue Dec 6, 2020 · 4 comments
Open

Working with private repos #9

jeffochoa opened this issue Dec 6, 2020 · 4 comments
Assignees
Labels
accessibility easy access and use of pipeline features feedback-appreciated curious for feedback and/or responses of open questions platform: macos reported against a non-linux system subsystem: ssh ssh agent forwarding

Comments

@jeffochoa
Copy link

Can't make it work with a private repository

Failed to clone the [email protected]:.....git repository, try running in interactive mode so that you can enter your Bitbucket OAuth consumer credentials

Is there a way to share my local ssh credentials with the docker container?

@ktomk
Copy link
Owner

ktomk commented Dec 6, 2020

Please try the --ssh switch from #6 .

@jeffochoa
Copy link
Author

Thanks @ktomk, I tried but it didn't work.

I'm using Mac, I wonder if has something to do with the SSH_AUTH_SOCK variable 🤔 Any idea?

@ktomk
Copy link
Owner

ktomk commented Dec 7, 2020

I'd say it depends. SSH_AUTH_SOCK should be available on Mac as well, it is the SSH agent.

However this might be a different issue. --ssh is to share your ssh credentials with the ssh-agent, when you clone, which authentication is in use? From your report I can see it is a bitbucket.org repository and it looks like it is using ssh.

You may try with a test-pipeline (similar as in #6) if it works that way with bitbucket:

$ mkdir -p ~/empty-directory-pipelines-test
$ cd ~/empty-directory-pipelines-test
$ <<'PIPELINE' bin/pipelines --file - --verbatim --ssh
pipelines:
  default:
    - step:
        image: ktomk/pipelines:ssh
        script:
          - mkdir -p -m 0600 ~/.ssh && ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
          - ssh -T [email protected] || test $? -eq 1
PIPELINE

with this example I get the authentication to run:

�+ mkdir -p -m 0600 ~/.ssh && ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
# bitbucket.org:22 SSH-2.0-conker_c123b90d72-dirty conker-3004
# bitbucket.org:22 SSH-2.0-conker_c123b90d72-dirty conker-3003
# bitbucket.org:22 SSH-2.0-conker_c123b90d72-dirty conker-3001
# bitbucket.org:22 SSH-2.0-conker_c123b90d72-dirty conker-3005
# bitbucket.org:22 SSH-2.0-conker_c123b90d72-dirty conker-3006

�+ ssh -T [email protected] || test $? -eq 1
Warning: Permanently added the RSA host key for IP address '104.192.141.1' to the list of known hosts.
logged in as ktomk

You can use git or hg to connect to Bitbucket. Shell access is disabled

which looks good so far as the authentication worked (and that shell access is disabled is fine, too).

please check if that example works for you. probably this is related to known hosts, we could see then how to give this a better accessibility/usability.

it would also help to have a better example at hand so that the issue becomes better reproducible. that is always helpful.

/Edit: The test is done best from within an empty directory. Before a full run and next to verbatim there is also the --no-run and the --dry-run switch.

@ktomk ktomk self-assigned this Dec 7, 2020
@ktomk ktomk added accessibility easy access and use of pipeline features feedback-appreciated curious for feedback and/or responses of open questions labels Dec 7, 2020
@ktomk
Copy link
Owner

ktomk commented Dec 12, 2020

The test instructions might have been incomplete and risk to copy large amounts of data into the test-container. I've edited my last comment accordingly and left a hint on the --no-run and --dry-run switch.

Also in a recent test in #6 a user could confirm --ssh is currently not working on macos. We're looking into it, however if you can confirm this is also useful information as I do not have a macos to test at hand.

@ktomk ktomk added platform: macos reported against a non-linux system subsystem: ssh ssh agent forwarding labels Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility easy access and use of pipeline features feedback-appreciated curious for feedback and/or responses of open questions platform: macos reported against a non-linux system subsystem: ssh ssh agent forwarding
Projects
None yet
Development

No branches or pull requests

2 participants