examples-sync.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233
  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.3.5
  7. ORIGIN_VERSION=${1:-v1.4}
  8. EXAMPLES_BASE=$(pwd)/files/examples/${ORIGIN_VERSION}
  9. find ${EXAMPLES_BASE} -name '*.json' -delete
  10. TEMP=`mktemp -d`
  11. pushd $TEMP
  12. wget https://github.com/openshift/origin/archive/master.zip -O origin-master.zip
  13. wget https://github.com/jboss-openshift/application-templates/archive/${XPAAS_VERSION}.zip -O application-templates-master.zip
  14. unzip origin-master.zip
  15. unzip application-templates-master.zip
  16. cp origin-master/examples/db-templates/* ${EXAMPLES_BASE}/db-templates/
  17. cp origin-master/examples/quickstarts/* ${EXAMPLES_BASE}/quickstart-templates/
  18. cp origin-master/examples/jenkins/jenkins-*template.json ${EXAMPLES_BASE}/quickstart-templates/
  19. cp origin-master/examples/image-streams/* ${EXAMPLES_BASE}/image-streams/
  20. mv application-templates-${XPAAS_VERSION}/jboss-image-streams.json ${EXAMPLES_BASE}/xpaas-streams/
  21. find application-templates-${XPAAS_VERSION}/ -name '*.json' ! -wholename '*secret*' ! -wholename '*demo*' -exec mv {} ${EXAMPLES_BASE}/xpaas-templates/ \;
  22. wget https://raw.githubusercontent.com/jboss-fuse/application-templates/GA/fis-image-streams.json -O ${EXAMPLES_BASE}/xpaas-streams/fis-image-streams.json
  23. wget https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/dotnet_imagestreams.json -O ${EXAMPLES_BASE}/image-streams/dotnet_imagestreams.json
  24. wget https://raw.githubusercontent.com/openshift/origin-metrics/master/metrics.yaml -O ${EXAMPLES_BASE}/infrastructure-templates/origin/metrics-deployer.yaml
  25. wget https://raw.githubusercontent.com/openshift/origin-metrics/enterprise/metrics.yaml -O ${EXAMPLES_BASE}/infrastructure-templates/enterprise/metrics-deployer.yaml
  26. wget https://raw.githubusercontent.com/openshift/origin-aggregated-logging/master/deployer/deployer.yaml -O ${EXAMPLES_BASE}/infrastructure-templates/origin/logging-deployer.yaml
  27. wget https://raw.githubusercontent.com/openshift/origin-aggregated-logging/enterprise/deployment/deployer.yaml -O ${EXAMPLES_BASE}/infrastructure-templates/enterprise/logging-deployer.yaml
  28. popd
  29. git diff files/examples