Skip to content

Commit b4711cf

Browse files
Roming22Bharath Nallapeta
authored andcommitted
Fix pipeline-service-ci setup
* Fix GitHub public key * Fix setup script Signed-off-by: Romain Arnaud <[email protected]>
1 parent b28e62b commit b4711cf

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.tekton/hack/setup_pipeline-service-ci.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,26 @@ generate_ssh_key() {
8585
setup_ssh_secret_directory() {
8686
mv "$TMPDIR/secret/ssh-privatekey.pub" "$TMPDIR/secret/ssh-publickey"
8787
cat <<EOF >"$TMPDIR/secret/known_hosts"
88-
github.com ssh-rsa AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
88+
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
8989
EOF
9090
}
9191

9292
create_ssh_secret() {
9393
kubectl create secret generic ssh-key --namespace pipeline-service-ci \
9494
--from-file="$TMPDIR/secret" \
95-
--type kubernetes.io/ssh-auth
95+
--type kubernetes.io/ssh-auth \
96+
--dry-run=client \
97+
-o yaml \
98+
| kubectl apply -f -
9699
kubectl annotate secret ssh-key --namespace pipeline-service-ci \
100+
--overwrite \
97101
"tekton.dev/git-0=github.com" # Flag the secret to be used to connect to GitHub
98102
}
99103

100104
register_ssh_key() {
101-
echo "Register the public key and enable 'Allow write access':"
102-
echo " URL: https://github.com/openshift-pipelines/pipeline-service/settings/keys"
103-
echo " Public key: $(cat "$TMPDIR/secret/ssh-publickey")"
105+
echo "Register the public key: https://github.com/openshift-pipelines/pipeline-service/settings/keys"
106+
echo " Key: $(cat "$TMPDIR/secret/ssh-publickey")"
107+
echo " Allow write access: True"
104108
read -rs -p "Press Enter to continue... "
105109
}
106110

@@ -123,7 +127,11 @@ generate_token() {
123127
}
124128

125129
create_token_secret() {
126-
kubectl create secret generic github --namespace pipeline-service-ci --from-file="$TMPDIR/secret"
130+
kubectl create secret generic github --namespace pipeline-service-ci \
131+
--from-file="$TMPDIR/secret" \
132+
--dry-run=client \
133+
-o yaml \
134+
| kubectl apply -f -
127135
rm -rf "$TMPDIR/secret"
128136
}
129137

.tekton/manifests/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ kind: Kustomization
44

55
resources:
66
- namespace.yaml
7-
- pipeline.yaml
87
- repository.yaml
8+
- serviceaccount.yaml

0 commit comments

Comments
 (0)