examples-sync.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. TEMP=`mktemp -d`
  9. pushd $TEMP
  10. wget https://github.com/openshift/origin/archive/master.zip -O origin-master.zip
  11. wget https://github.com/openshift/django-ex/archive/master.zip -O django-ex-master.zip
  12. wget https://github.com/openshift/rails-ex/archive/master.zip -O rails-ex-master.zip
  13. wget https://github.com/openshift/nodejs-ex/archive/master.zip -O nodejs-ex-master.zip
  14. wget https://github.com/openshift/dancer-ex/archive/master.zip -O dancer-ex-master.zip
  15. wget https://github.com/openshift/cakephp-ex/archive/master.zip -O cakephp-ex-master.zip
  16. wget https://github.com/jboss-openshift/application-templates/archive/master.zip -O application-templates-master.zip
  17. unzip origin-master.zip
  18. unzip django-ex-master.zip
  19. unzip rails-ex-master.zip
  20. unzip nodejs-ex-master.zip
  21. unzip dancer-ex-master.zip
  22. unzip cakephp-ex-master.zip
  23. unzip application-templates-master.zip
  24. cp origin-master/examples/db-templates/* ${EXAMPLES_BASE}/db-templates/
  25. cp origin-master/examples/jenkins/jenkins-*template.json ${EXAMPLES_BASE}/quickstart-templates/
  26. cp origin-master/examples/image-streams/* ${EXAMPLES_BASE}/image-streams/
  27. cp django-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  28. cp rails-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  29. cp nodejs-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  30. cp dancer-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  31. cp cakephp-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
  32. mv application-templates-master/jboss-image-streams.json ${EXAMPLES_BASE}/xpaas-streams/
  33. find application-templates-master/ -name '*.json' ! -wholename '*secret*' -exec mv {} ${EXAMPLES_BASE}/xpaas-templates/ \;
  34. popd
  35. git diff files/examples