############################### Trusty ######################################### gcloud compute instances create ubuntu-1404-trusty-v20170307 --image-project ubuntu-os-cloud --image "ubuntu-1404-trusty-v20170307" --metadata shutdown-script="#! /bin/bash touch /home/ubuntu/shutdown.txt",startup-script="#! /bin/bash touch /home/ubuntu/startup.txt" # Run the following on the running instance # clean up instance ready for testing rm -f ~/startup.txt #Enable proposed echo "deb http://archive.ubuntu.com/ubuntu/ trusty-proposed restricted main multiverse universe" | sudo tee --append /etc/apt/sources.list sudo apt-get update sudo apt-get install --only-upgrade gce-compute-image-packages # Add PPA with a higher version number of the same package so we can test upgrade with the same package sudo add-apt-repository -y ppa:philroche/lp1668327-startupscript-package-update-trusty sudo apt-get update sudo apt-get install --only-upgrade gce-compute-image-packages if [ ! -f ~/shutdown.txt ]; then echo "Shutdown File not found! Bug fixed" fi # clean up instance ready for testing rm -f ~/shutdown.txt ~/startup.txt # restart to test startup and shutdown scripts still work sudo reboot if [ -f ~/startup.txt ]; then echo "Startup File found! Startup scripts work" rm -f ~/startup.txt fi if [ -f ~/shutdown.txt ]; then echo "Shutdown File found! Shutdown scripts work" rm -f ~/shutdown.txt fi # If you wish to reset completely run the following rm -f ~/shutdown.txt ~/startup.txt sudo apt-get install ppa-purge sudo ppa-purge -y ppa:philroche/lp1668327-startupscript-package-update-trusty