Skip to content

Commit

Permalink
Merge pull request rancher#47635 from rancher/markus/task-1596
Browse files Browse the repository at this point in the history
[Main] Add RSA key authentication support to Jenkins
  • Loading branch information
markusewalker authored Oct 21, 2024
2 parents 04a7125 + eeef553 commit ae9edd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/v2/validation/Dockerfile.validation
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ ENV CORRAL_VERSION="v1.1.1"
RUN go install github.com/rancherlabs/corral@${CORRAL_VERSION}

RUN mkdir /root/.ssh && chmod 600 .ssh/jenkins-*
RUN ssh-keygen -f .ssh/jenkins-* -y > /root/.ssh/public.pub
RUN for pem_file in .ssh/jenkins-*; do \
ssh-keygen -f "$pem_file" -y > "/root/.ssh/$(basename "$pem_file").pub"; \
done

RUN CGO_ENABLED=0

Expand Down
7 changes: 6 additions & 1 deletion tests/v2/validation/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ node {
string(credentialsId: 'AWS_SECRET_ACCESS_KEY', variable: 'RANCHER_EKS_SECRET_KEY'),
string(credentialsId: 'DO_ACCESSKEY', variable: 'DO_ACCESSKEY'),
string(credentialsId: 'AWS_SSH_PEM_KEY', variable: 'AWS_SSH_PEM_KEY'),
string(credentialsId: 'AWS_SSH_RSA_KEY', variable: 'AWS_SSH_RSA_KEY'),
string(credentialsId: 'RANCHER_SSH_KEY', variable: 'RANCHER_SSH_KEY'),
string(credentialsId: 'AZURE_SUBSCRIPTION_ID', variable: 'AZURE_SUBSCRIPTION_ID'),
string(credentialsId: 'AZURE_TENANT_ID', variable: 'AZURE_TENANT_ID'),
Expand Down Expand Up @@ -81,7 +82,6 @@ node {
string(credentialsId: 'QASE_AUTOMATION_TOKEN', variable: 'QASE_AUTOMATION_TOKEN'),
string(credentialsId: 'SLACK_WEBHOOK', variable: 'SLACK_WEBHOOK'),
string(credentialsId: 'RANCHER_LINODE_ACCESSKEY', variable: "RANCHER_LINODE_ACCESSKEY")]) {

withEnv(paramsMap) {
stage('Checkout') {
deleteDir()
Expand All @@ -102,6 +102,11 @@ node {
}
}

dir("./tests/v2/validation/.ssh") {
def decodedRsa = new String(AWS_SSH_RSA_KEY.decodeBase64())
writeFile file: JENKINS_RKE_VALIDATION, text: decodedRsa
}

dir("./tests/v2/validation") {
def filename = "config.yaml"
def configContents = env.CONFIG
Expand Down

0 comments on commit ae9edd7

Please sign in to comment.