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

feat: [CI-15212]: add ssh passphrase support #113

Merged
merged 12 commits into from
Jan 22, 2025
Merged

Conversation

abhay084
Copy link
Contributor

@abhay084 abhay084 commented Jan 3, 2025

Added ssh passphrase support for linux based git clone steps.
From CI-manager we will pass the SSH Key and SSH_PASSPHRASE to the plugin. Using the given passphrase we will reset the to empty passphrase with given added change. This is been tested for Github, Gitlab, bitbucket and Azure code repository. Below is example test image for Gitlab.

CI-manager changes are associated with this pr: https://app.harness.io/ng/account/vpCkHKsDSxK9_KYfjCTMKA/module/code/orgs/HarnessHCRInternalUAT/projects/Harness_Code/repos/harness-core/pulls/71369

Screenshot 2025-01-16 at 11 17 31 AM Screenshot 2025-01-16 at 11 13 58 AM Screenshot 2025-01-17 at 12 43 45 PM

@abhay084 abhay084 requested a review from devkimittal January 16, 2025 05:49
posix/clone Outdated Show resolved Hide resolved
raghavharness
raghavharness previously approved these changes Jan 19, 2025
posix/clone Outdated

ssh-keyscan -H ${SSH_PORT_FLAG} ${SSH_KEYSCAN_TIMEOUT_FLAG} ${DRONE_NETRC_MACHINE} > ${HOME}/.ssh/known_hosts 2> /dev/null
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=${HOME}/.ssh/known_hosts -i ${HOME}/.ssh/id_rsa ${SSH_PORT_FLAG} -F /dev/null"
mkdir -p "${HOME}/.ssh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not change the indentation?

@@ -1,4 +1,4 @@
image: harness/drone-git:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-rootless
image: abhayganvir/drone-git:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}-rootless
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cough cough

raghavharness
raghavharness previously approved these changes Jan 22, 2025
@rajatharanganath rajatharanganath merged commit 549cbdb into master Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants