kubectl apply -f https://raw.githubusercontent.com/openshift-pipelines/pipelines-as-code/release-0.1/release-0.1.yaml
oc expose service el-pipelines-as-code-interceptor -n pipelines-as-code
You need the jq tool for this
oc apply -n pipelines-as-code -f <(oc get -n pipelines-as-code route el-pipelines-as-code-interceptor -o json |jq -r '.spec |= . + {tls: {"insecureEdgeTerminationPolicy": "Redirect", "termination": "edge"}}')
Get the EventListenner URL and store it somewhere as $EL_URL_ROUTE we will need for Github APP for the Callback URL field.
echo https://$(oc get route -n pipelines-as-code el-pipelines-as-code-interceptor -o jsonpath='{.spec.host}')
openssl rand -hex 20
- Go to https://github.com/settings/apps and click on “New GitHub APP” button
- fill the “GitHub App name”, “Homepage URL”
- Fill the WebHook URL $EL_URL_ROUTE from the route/ingress you exposed before.
- Fill the Webhook secret $WEBHOOK_SECRET with the previously generated one
- Disable SSL verification if you don’t have TLS certs on your route (not recommended)
- Go to https://github.com/openshift-pipelines/pipelines-as-code/blob/main/INSTALL.md#github-configuration and check the boxes/permissions as specified there.
- Click on Create Github APP
- Take note of the App ID” at the top and store it somewhere as $APP_ID
- Scroll down and click on Generate Private key, it will download a file to your computer, take note of the name of the file.
- On the command line do :
kubectl -n pipelines-as-code create secret generic github-app-secret \
--from-literal private.key="$(cat ~/Downloads/*.private-.pem)"
--from-literal application_id="${APP_ID}" \
--from-literal webhook.secret="$WEBHOOK_SECRET
Get to https://github.com/settings/apps/ and grab the APP URL, here :
Go to Install APP and install the app on the repository
git clone git@github.com:chmouel/demo.git
tkn pac repo new
git checkout -b tektonci git add .tekton git commit -m "Add tekton ci 🐱" git push -u origin tektonci
tkn pr ls -n pipelines-as-code