Last active
June 9, 2016 15:09
-
-
Save tnozicka/1dfe66c4bed4eb1bb42c8ab898e041dc to your computer and use it in GitHub Desktop.
Jenkins on oc cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SOURCE_CMD='curl -sL' && \ | |
SOURCE='https://github.com/projectatomic/adb-utils/raw/master/services/openshift/templates' && \ | |
echo "" | oc login -u system:admin || oc login -u admin -p admin && \ | |
oc delete is jenkins -n openshift && \ | |
for t in adb/image-streams.json adb/jenkins-ephemeral-next-template.json common/jenkins-ephemeral-template.json adb/jenkins-persistent-next-template.json common/jenkins-persistent-template.json common/jenkins-slave-template.json; do \ | |
echo "Importing ${SOURCE}/${t}" && \ | |
${SOURCE_CMD} ${SOURCE}/${t} | oc create -n openshift -f -; \ | |
done && \ | |
oc process openshift//jenkins-slave-builder -v 'IMAGE_NAME=tnozicka/openshift-maven-builder,IMAGE_STREAM_NAME=maven' | oc create -n openshift -f - && \ | |
oc login -u developer -p developer || oc login -u admin -p admin && \ | |
oc new-project pipelineproject && \ | |
oc process openshift//jenkins-ephemeral-next -v PROJECT="" | oc create -n pipelineproject -f - && \ | |
echo "" | oc login -u system:admin || oc login -u admin -p admin && \ | |
oc annotate is -n openshift jenkins foo=bar && \ | |
echo "Openshift Docker Registry URL: $(oc get svc docker-registry -n default -o go-template='{{.spec.clusterIP}}'):$(oc get svc docker-registry -n default -o go-template='{{index .spec.ports 0 "port"}}')" && \ | |
oc login -u developer -p developer || oc login -u admin -p admin # /opt/app-root/jenkins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment