Skip to content

Commit

Permalink
Update pipeline-build-template.yaml
Browse files Browse the repository at this point in the history
* Added openshift secret to store git private ssh key
  • Loading branch information
emuthiah committed Apr 27, 2020
1 parent 7c23813 commit 5bdeca0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions openshift/meta-templates/pipeline-build-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ parameters:
displayName: Context Directory
name: gitContextDir
value:
- description: Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted.
- description: Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted.
displayName: GitHub Webhook Secret (Generated if empty)
from: '[a-zA-Z0-9]{40}'
generate: expression
name: gitSecret
- description: The ID (name) of the git ssh private key as stored in Jenkins Credential Store
displayName: Git Jenkins Credentials ID
name: gitJenkinsCredentialsId
value:
- description: The git ssh private key to access/write git repo (synced to Jenkins Credential Store)
displayName: Git ssh private key
name: gitSshPrivateKey
value: c2V0LnNzaC1wcml2YXRlLWtleQ==
- description: The OpenShift Namespace prefix where the ImageStreams reside.

This comment has been minimized.

Copy link
@ChrisHoban

ChrisHoban Apr 27, 2020

Owner

What is this secret for?

This comment has been minimized.

Copy link
@emuthiah

emuthiah Apr 27, 2020

Author Contributor

It is just a placeholder for ssh private key. it is base64 of set.ssh-private-key. The secret is of the type kubernetes.io/ssh-auth so openshift expects some base64 value there.

displayName: Namespace Prefix (Prefix for each namespace ie prefix-tools, prefix-dev etc)
name: namespacePrefix
Expand Down Expand Up @@ -160,6 +160,16 @@ parameters:
value:

objects:
- apiVersion: v1
data:
ssh-privatekey: >-
${gitSshPrivateKey}
kind: Secret
metadata:
labels:
credential.sync.jenkins.openshift.io: 'true'
name: ${appName}-github-key
type: kubernetes.io/ssh-auth
- apiVersion: v1
kind: ImageStream
metadata:
Expand Down Expand Up @@ -198,7 +208,7 @@ objects:
- name: GIT_SOURCE_REF
value: ${gitRef}
- name: GIT_CREDENTIALS_ID
value: ${gitJenkinsCredentialsId}
value: ${appName}-github-key
- name: GIT_CONTEXT_DIR
value: ${gitContextDir}
- name: CHECKOUT_SRC
Expand Down

0 comments on commit 5bdeca0

Please sign in to comment.