examples-sync.sh 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. # Utility script to update the ansible repo with the latest templates and image
  3. # streams from several github repos
  4. #
  5. # This script should be run from openshift-ansible/roles/openshift_examples
  6. XPAAS_VERSION=ose-v1.4.12
  7. RHDM70_VERSION=ose-v1.4.8-1
  8. ORIGIN_VERSION=${1:-v3.9}
  9. ORIGIN_BRANCH=${2:-master}
  10. RHAMP_TAG=2.0.0.GA
  11. EXAMPLES_BASE=$(pwd)/files/examples/${ORIGIN_VERSION}
  12. find ${EXAMPLES_BASE} -name '*.json' -delete
  13. TEMP=`mktemp -d`
  14. pushd $TEMP
  15. if [ ! -d "${EXAMPLES_BASE}" ]; then
  16. mkdir -p ${EXAMPLES_BASE}
  17. fi
  18. wget https://github.com/openshift/origin/archive/${ORIGIN_BRANCH}.zip -O origin.zip
  19. wget https://github.com/jboss-fuse/application-templates/archive/GA.zip -O fis-GA.zip
  20. wget https://github.com/jboss-openshift/application-templates/archive/${XPAAS_VERSION}.zip -O application-templates-master.zip
  21. wget https://github.com/jboss-container-images/rhdm-7-openshift-image/archive/${RHDM70_VERSION}.zip -O rhdm-application-templates.zip
  22. wget https://github.com/3scale/rhamp-openshift-templates/archive/${RHAMP_TAG}.zip -O amp.zip
  23. unzip origin.zip
  24. unzip application-templates-master.zip
  25. unzip rhdm-application-templates.zip
  26. unzip fis-GA.zip
  27. unzip amp.zip
  28. mv origin-${ORIGIN_BRANCH}/examples/db-templates/* ${EXAMPLES_BASE}/db-templates/
  29. mv origin-${ORIGIN_BRANCH}/examples/quickstarts/* ${EXAMPLES_BASE}/quickstart-templates/
  30. mv origin-${ORIGIN_BRANCH}/examples/jenkins/jenkins-*template.json ${EXAMPLES_BASE}/quickstart-templates/
  31. mv origin-${ORIGIN_BRANCH}/examples/image-streams/* ${EXAMPLES_BASE}/image-streams/
  32. mv application-templates-${XPAAS_VERSION}/jboss-image-streams.json ${EXAMPLES_BASE}/xpaas-streams/
  33. mv rhdm-7-openshift-image-${RHDM70_VERSION}/rhdm70-image-streams.yaml ${EXAMPLES_BASE}/xpaas-streams/
  34. # fis content from jboss-fuse/application-templates-GA would collide with jboss-openshift/application-templates
  35. # as soon as they use the same branch/tag names
  36. mv application-templates-GA/fis-image-streams.json ${EXAMPLES_BASE}/xpaas-streams/fis-image-streams.json
  37. mv application-templates-GA/quickstarts/* ${EXAMPLES_BASE}/xpaas-templates/
  38. find application-templates-${XPAAS_VERSION}/ -name '*.json' ! -wholename '*secret*' ! -wholename '*demo*' ! -wholename '*image-stream.json' -exec mv {} ${EXAMPLES_BASE}/xpaas-templates/ \;
  39. find application-templates-${XPAAS_VERSION}/ -name '*image-stream.json' -exec mv {} ${EXAMPLES_BASE}/xpaas-streams/ \;
  40. find rhdm-7-openshift-image-${RHDM70_VERSION}/templates -name '*.yaml' -exec mv {} ${EXAMPLES_BASE}/xpaas-templates/ \;
  41. find 3scale-amp-openshift-templates-${RHAMP_TAG}/ -name '*.yml' -exec mv {} ${EXAMPLES_BASE}/quickstart-templates/ \;
  42. popd
  43. wget https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/dotnet_imagestreams.json -O ${EXAMPLES_BASE}/image-streams/dotnet_imagestreams.json
  44. wget https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/dotnet_imagestreams_centos.json -O ${EXAMPLES_BASE}/image-streams/dotnet_imagestreams_centos.json
  45. wget https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/templates/dotnet-example.json -O ${EXAMPLES_BASE}/quickstart-templates/dotnet-example.json
  46. wget https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/templates/dotnet-pgsql-persistent.json -O ${EXAMPLES_BASE}/quickstart-templates/dotnet-pgsql-persistent.json
  47. wget https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/templates/dotnet-runtime-example.json -O ${EXAMPLES_BASE}/quickstart-templates/dotnet-runtime-example.json
  48. git diff files/examples