| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # Create and setup the Skia RecreateSKPs GCE instance. | 3 # Create and setup the Skia RecreateSKPs GCE instance. |
| 4 # | 4 # |
| 5 # Copyright 2014 Google Inc. All Rights Reserved. | 5 # Copyright 2014 Google Inc. All Rights Reserved. |
| 6 # Author: rmistry@google.com (Ravi Mistry) | 6 # Author: rmistry@google.com (Ravi Mistry) |
| 7 | 7 |
| 8 source vm_config.sh | 8 source vm_config.sh |
| 9 source vm_setup_utils.sh | 9 source vm_setup_utils.sh |
| 10 | 10 |
| 11 # Set OS specific GCE variables. | 11 # Set OS specific GCE variables. |
| 12 if [ "$VM_INSTANCE_OS" == "Linux" ]; then | 12 if [ "$VM_INSTANCE_OS" == "Linux" ]; then |
| 13 SKIA_BOT_IMAGE_NAME=$SKIA_BOT_LINUX_IMAGE_NAME | 13 SKIA_BOT_IMAGE_NAME=$SKIA_BOT_LINUX_IMAGE_NAME |
| 14 REQUIRED_FILES_FOR_BOTS=${REQUIRED_FILES_FOR_LINUX_BOTS[@]} | 14 REQUIRED_FILES_FOR_BOTS=${REQUIRED_FILES_FOR_LINUX_BOTS[@]} |
| 15 WAIT_TIME_AFTER_CREATION_SECS=240 | 15 WAIT_TIME_AFTER_CREATION_SECS=600 |
| 16 elif [ "$VM_INSTANCE_OS" == "Windows" ]; then | 16 elif [ "$VM_INSTANCE_OS" == "Windows" ]; then |
| 17 SKIA_BOT_IMAGE_NAME=$SKIA_BOT_WIN_IMAGE_NAME | 17 SKIA_BOT_IMAGE_NAME=$SKIA_BOT_WIN_IMAGE_NAME |
| 18 ZONE=$WINDOWS_ZONE | 18 ZONE=$WINDOWS_ZONE |
| 19 | 19 |
| 20 ORIG_STARTUP_SCRIPT="../../scripts/win_setup.ps1" | 20 ORIG_STARTUP_SCRIPT="../../scripts/win_setup.ps1" |
| 21 MODIFIED_STARTUP_SCRIPT="/tmp/win_setup.ps1" | 21 MODIFIED_STARTUP_SCRIPT="/tmp/win_setup.ps1" |
| 22 # Set chrome-bot's password in win_setup.ps1 | 22 # Set chrome-bot's password in win_setup.ps1 |
| 23 cp $ORIG_STARTUP_SCRIPT $MODIFIED_STARTUP_SCRIPT | 23 cp $ORIG_STARTUP_SCRIPT $MODIFIED_STARTUP_SCRIPT |
| 24 sed -i "s/CHROME_BOT_PASSWORD/$(echo $(cat /tmp/gce.txt) | sed -e 's/[\/&]/\\&
/g')/g" $MODIFIED_STARTUP_SCRIPT | 24 sed -i "s/CHROME_BOT_PASSWORD/$(echo $(cat /tmp/gce.txt) | sed -e 's/[\/&]/\\&
/g')/g" $MODIFIED_STARTUP_SCRIPT |
| 25 sed -i "s/GS_ACCESS_KEY_ID/$(echo $(cat ~/.boto | sed -n 2p) | sed -e 's/[\/&]
/\\&/g')/g" $MODIFIED_STARTUP_SCRIPT | 25 sed -i "s/GS_ACCESS_KEY_ID/$(echo $(cat ~/.boto | sed -n 2p) | sed -e 's/[\/&]
/\\&/g')/g" $MODIFIED_STARTUP_SCRIPT |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 # Restart the windows instance to run chrome-bot's scheduled task. | 119 # Restart the windows instance to run chrome-bot's scheduled task. |
| 120 $GCOMPUTE_CMD resetinstance $INSTANCE_NAME | 120 $GCOMPUTE_CMD resetinstance $INSTANCE_NAME |
| 121 fi | 121 fi |
| 122 done | 122 done |
| 123 | 123 |
| 124 cat <<INP | 124 cat <<INP |
| 125 | 125 |
| 126 Instances are ready to use. | 126 Instances are ready to use. |
| 127 | 127 |
| 128 INP | 128 INP |
| OLD | NEW |