oc adm new-project myproject \
--node-selector='label.key=label.value'
$ oc create sa cicd
$ oc adm policy add-role-to-user edit -z cicd
$ oc sa get-token <service account name>
$ oc get dc <dc name> -o yaml -n <project> | sed 's/automatic: true/automatic: false/g' | oc replace -f -
$ oc patch ...
oc get bc/<build name> -o=jsonpath='{.spec.triggers..github.secret}{"\n"}'
To get the Webhook URL:
oc describe bc/<build name>
Then look for Webhook Github: and copy the URL:. You will have to replace <secret> with the secret you retrieved in the first step.
You can easily set an env var on a deployment config from the cli:
oc set env dc/<dc name> key=value
oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"routes":[{"name":"public-routes","hostname":"registry.apps.<cluster url>"}]}}' --type=merge
Triggering a rollout on a Deployment is slightly different than a DeploymentConfig:
oc rollout restart deployment <deployment name> -n <namespace>