examples-sync.sh 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.1.0
  7. ORIGIN_VERSION=v1.1
  8. EXAMPLES_BASE=$(pwd)/files/examples/${ORIGIN_VERSION}
  9. find ${EXAMPLES_BASE} -name '*.json' -delete
  10. find ${EXAMPLES_BASE} -name '*.yaml' -delete
  11. TEMP=`mktemp -d`
  12. pushd $TEMP
  13. wget https://github.com/openshift/origin/archive/master.zip -O origin-master.zip
  14. wget https://github.com/openshift/django-ex/archive/master.zip -O django-ex-master.zip
  15. wget https://github.com/openshift/rails-ex/archive/master.zip -O rails-ex-master.zip
  16. wget https://github.com/openshift/nodejs-ex/archive/master.zip -O nodejs-ex-master.zip
  17. wget https://github.com/openshift/dancer-ex/archive/master.zip -O dancer-ex-master.zip
  18. wget https://github.com/openshift/cakephp-ex/archive/master.zip -O cakephp-ex-master.zip
  19. wget https://github.com/jboss-openshift/application-templates/archive/${XPAAS_VERSION}.zip -O application-templates-master.zip
  20. unzip origin-master.zip
  21. unzip django-ex-master.zip
  22. unzip rails-ex-master.zip
  23. unzip nodejs-ex-master.zip
  24. unzip dancer-ex-master.zip
  25. unzip cakephp-ex-master.zip
  26. unzip application-templates-master.zip
  27. cp origin-master/examples/db-templates/* ${EXAMPLES_BASE}/db-templates/
  28. cp origin-master/examples/jenkins/jenkins-*template.json ${EXAMPLES_BASE}/quickstart-templates/
  29. cp origin-master/examples/image-streams/* ${EXAMPLES_BASE}/image-streams/
  30. cp django-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  31. cp rails-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  32. cp nodejs-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  33. cp dancer-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  34. cp cakephp-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  35. mv application-templates-${XPAAS_VERSION}/jboss-image-streams.json ${EXAMPLES_BASE}/xpaas-streams/
  36. find application-templates-${XPAAS_VERSION}/ -name '*.json' ! -wholename '*secret*' -exec mv {} ${EXAMPLES_BASE}/xpaas-templates/ \;
  37. wget https://raw.githubusercontent.com/openshift/origin-metrics/master/metrics.yaml -O ${EXAMPLES_BASE}/infrastructure-templates/origin/metrics-deployer.yaml
  38. cp ${EXAMPLES_BASE}/infrastructure-templates/origin/metrics-*.yaml ${EXAMPLES_BASE}/infrastructure-templates/enterprise/
  39. wget https://raw.githubusercontent.com/openshift/origin-aggregated-logging/master/deployment/deployer.yaml -O ${EXAMPLES_BASE}/infrastructure-templates/origin/logging-deployer.yaml
  40. wget https://raw.githubusercontent.com/openshift/origin-aggregated-logging/enterprise/deployment/deployer.yaml -O ${EXAMPLES_BASE}/infrastructure-templates/enterprise/logging-deployer.yaml
  41. popd
  42. git diff files/examples