Advertisement
pavel_ch

Jenkins conf

Jan 13th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.81 KB | None | 0 0
  1. echo this is the version ${SGW_VERSION}
  2.  
  3. if [ ! -d ${WORKSPASE}/vhost]; then
  4.     git clone -b centos6 http://gitlab.cisco.com/drm-he-ci/vagrant.git vhost
  5.     cd vhost
  6. else
  7.     cd vhost
  8.     git pull
  9. fi
  10.  
  11. name=cihost"$(date +%s)"
  12. cp -r vsphere_centos67 $name
  13. cd $name
  14. export VAGRANT_INSTANCE_NAME=$name
  15. vagrant up --provider=vsphere
  16.  
  17. VAGRANT_INSTANCE_PATH="$(pwd)"
  18.  
  19. vagrant ssh-config | grep -i hostname | awk '{print$2}' > ipaddress
  20. export VAGRANT_INSTANCE_IP=$(awk {print} ipaddress)
  21. echo Host IP is $VAGRANT_INSTANCE_IP
  22.  
  23. cd ${WORKSPACE}
  24. #Apply puppet SK profile
  25. cat > configure.sh <<EOF
  26. #!/bin/bash
  27. cd /etc/puppet
  28. git pull
  29. cat > /etc/puppet/hieradata/override.json <<EOL
  30. { "sgw::version":"${SGW_VERSION}",
  31.   "ecms::version":"1.8.2-0",
  32.   "drms::version":"${DRMS_VERSION}",
  33.   "keystore::version":"1.1.4-7",
  34.   "tgs::version":"1.5.4-0",
  35.   "upm::version":"5.67.1-0"
  36. }
  37. EOL
  38. puppet apply -e "include profile::new_repo"
  39. puppet apply -e "include profile::starter_kit"
  40. cp -r /opt/nds/mama/docs/sample/* /opt/nds/mama/etc/
  41. sed -i "1 i.*" /opt/nds/mama/etc/legal_commands_basic.cfg
  42. service nds_mama start
  43. EOF
  44. ssh root@$VAGRANT_INSTANCE_IP < configure.sh
  45.  
  46. vmip=$VAGRANT_INSTANCE_IP
  47. #Change host IP
  48. sed -i s#sgw_1.1.host.*\$#sgw_1.1.host=$vmip# src/test/resources/config.properties
  49. sed -i s#drms.host.*\$#drms.host=$vmip# src/test/resources/config.properties
  50. sed -i s#ecms.host.*\$#ecms.host=$vmip# src/test/resources/config.properties
  51. sed -i s#tgs.host.*\$#tgs.host=$vmip# src/test/resources/config.properties
  52. sed -i s#keystore.host.*\$#keystore.host=$vmip# src/test/resources/config.properties
  53. sed -i s#upm.host.*\$#upm.host=$vmip# src/test/resources/config.properties
  54.  
  55. cat > ${WORKSPACE}/params.properties <<EOF
  56. SGW_VERSION=${SGW_VERSION}
  57. VAGRANT_INSTANCE_PATH=$VAGRANT_INSTANCE_PATH
  58. EOF
  59. cat params.properties
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement