Skip to content

Instantly share code, notes, and snippets.

@csrwng
Last active March 8, 2017 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csrwng/da9510ed99bbd4891ae618dce314acad to your computer and use it in GitHub Desktop.
Save csrwng/da9510ed99bbd4891ae618dce314acad to your computer and use it in GitHub Desktop.
Build oc client using an OpenShift Cluster
#/bin/bash
# NOTE: Create a separate project for each platform/branch you're building
# For a Mac client (substitute SOURCE_URL and SOURCE_REF to build a specific PR or fork):
oc new-app -f https://raw.githubusercontent.com/csrwng/build-origin/master/origin-builder.yaml \
-p SOURCE_URL=https://github.com/openshift/origin.git \
-p SOURCE_REF=master \
-p PLATFORM=darwin/amd64
# For a Windows client:
oc new-app -f https://raw.githubusercontent.com/csrwng/build-origin/master/origin-builder.yaml \
-p SOURCE_URL=https://github.com/openshift/origin.git \
-p SOURCE_REF=master \
-p PLATFORM=windows/amd64
# For Linux client:
oc new-app -f https://raw.githubusercontent.com/csrwng/build-origin/master/origin-builder.yaml \
-p SOURCE_URL=https://github.com/openshift/origin.git \
-p SOURCE_REF=master \
-p PLATFORM=windows/amd64
# Watch for endpoints of the service to be available... when available, the build is finished.
oc get endpoints build-origin --watch
# Once the build is finished, the oc binary can be downloaded via HTTP via an exposed route
oc get route build-origin
# Download from the route host:
curl -O http://[route-host]/[platform]/amd64/oc[.exe]
# To rebuild from the same branch/ref, simple start the build again (no need to recreate artifacts):
oc start-build build-origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment