examples-sync.sh 2.6 KB

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