Created
July 15, 2015 22:45
-
-
Save igable/73bf1c650553f9336c86 to your computer and use it in GitHub Desktop.
Make some examples files for life DCM endpoint testing with Mixcoatl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Create some example files for interactive live testing | |
# these could possibly be rolled into the mixcoatl repo proper | |
# | |
if [ ! -d secret-test-data ]; then mkdir secret-test-data; fi | |
cat <<'EOF' > secret-test-data/endpoints.json | |
[ | |
{ | |
"nickname": "saas", | |
"url": "https://dcm.enstratius.com/api/enstratus/2015-05-25", | |
"api_version": "2015-05-25", | |
"access_key": "abcdefg", | |
"secret_key": "gfedcba" | |
}, | |
{ | |
"nickname": "vagrant", | |
"url": "https://vagrant.vm/api/enstratus/2015-05-25", | |
"api_version": "2015-05-25", | |
"access_key": "abcdefg", | |
"secret_key": "gfedcba", | |
"ssl_verify": false | |
} | |
] | |
EOF | |
cat <<'EOF' > secret-test-data/ubuntu-trusty-14.04-amd64-server-20150629.json | |
{ | |
"name": "mixcoatl-saas-ubuntu-14.04", | |
"provider_product_id": "t1.micro", | |
"machine_image": 50705, | |
"data_center": 1273, | |
"description": "Mixcoatl SaaS testing", | |
"budget": 1512, | |
"userData": "#!/bin/bash\n\n# CHANGE BELOW\nDCM_HOST=dcm.enstratius.com\n# CHANGE ABOVE\n\nsed -i 's/Defaults .*requiretty//' /etc/sudoers || true\n# The bash url could also be http://s3.amazonaws.com/dcmagentnightly\nexport AGENT_BASE_URL=https://s3.amazonaws.com/dcmagentunstable\n\n# we need to be sure that the network is ready before running the script\nBOOT_LOG=/tmp/boot.log\ntouch $BOOT_LOG\ncd /tmp\nwhich curl\nif [ $? -ne 0 ]; then\n echo \"CURL IS NOT INSTALLED\" >> $BOOT_LOG\n exit 1\nfi\ncurl -kr 10 $AGENT_BASE_URL/installer.sh > installer.sh\necho \"got the installer\" >> $BOOT_LOG\nbash installer.sh -Z --loglevel DEBUG --base-path /dcm -B --url wss://$DCM_HOST/agentManager --extra-package-location $AGENT_BASE_URL >> $BOOT_LOG 2> /tmp/error.log\necho $? >> $BOOT_LOG\necho \"ran installer\" >> $BOOT_LOG\n/dcm/bin/enstratiusinitd start >> $BOOT_LOG" | |
} | |
EOF | |
cat <<'EOF' > secret-test-data/vagrant-volume.json | |
{ | |
"name": "one-gig-vagrant-volume", | |
"data_center": 24, | |
"budget": 200, | |
"size_in_gb": 1, | |
"description": "mixcoatl testing volume" | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment