examples-sync.sh 2.7 KB

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