Browse Source

Allow branch specific pulls from origin

Scott Dodson 7 years ago
parent
commit
54b39c1ad9
1 changed files with 7 additions and 6 deletions
  1. 7 6
      roles/openshift_examples/examples-sync.sh

+ 7 - 6
roles/openshift_examples/examples-sync.sh

@@ -7,6 +7,7 @@
 
 XPAAS_VERSION=ose-v1.4.8-1
 ORIGIN_VERSION=${1:-v3.9}
+ORIGIN_BRANCH=${2:-master}
 RHAMP_TAG=2.0.0.GA
 EXAMPLES_BASE=$(pwd)/files/examples/${ORIGIN_VERSION}
 find ${EXAMPLES_BASE} -name '*.json' -delete
@@ -16,18 +17,18 @@ pushd $TEMP
 if [ ! -d "${EXAMPLES_BASE}" ]; then
   mkdir -p ${EXAMPLES_BASE}
 fi
-wget https://github.com/openshift/origin/archive/master.zip -O origin-master.zip
+wget https://github.com/openshift/origin/archive/${ORIGIN_BRANCH}.zip -O origin.zip
 wget https://github.com/jboss-fuse/application-templates/archive/GA.zip -O fis-GA.zip
 wget https://github.com/jboss-openshift/application-templates/archive/${XPAAS_VERSION}.zip -O application-templates-master.zip
 wget https://github.com/3scale/rhamp-openshift-templates/archive/${RHAMP_TAG}.zip -O amp.zip
-unzip origin-master.zip
+unzip origin.zip
 unzip application-templates-master.zip
 unzip fis-GA.zip
 unzip amp.zip
-mv origin-master/examples/db-templates/* ${EXAMPLES_BASE}/db-templates/
-mv origin-master/examples/quickstarts/* ${EXAMPLES_BASE}/quickstart-templates/
-mv origin-master/examples/jenkins/jenkins-*template.json ${EXAMPLES_BASE}/quickstart-templates/
-mv origin-master/examples/image-streams/* ${EXAMPLES_BASE}/image-streams/
+mv origin-${ORIGIN_BRANCH}/examples/db-templates/* ${EXAMPLES_BASE}/db-templates/
+mv origin-${ORIGIN_BRANCH}/examples/quickstarts/* ${EXAMPLES_BASE}/quickstart-templates/
+mv origin-${ORIGIN_BRANCH}/examples/jenkins/jenkins-*template.json ${EXAMPLES_BASE}/quickstart-templates/
+mv origin-${ORIGIN_BRANCH}/examples/image-streams/* ${EXAMPLES_BASE}/image-streams/
 mv application-templates-${XPAAS_VERSION}/jboss-image-streams.json ${EXAMPLES_BASE}/xpaas-streams/
 # fis content from jboss-fuse/application-templates-GA would collide with jboss-openshift/application-templates
 # as soon as they use the same branch/tag names