Skip to content

Commit 72b540b

Browse files
authored
fix: add error handling
exit immediately if a command exits with non-zero status
1 parent ebfbcc0 commit 72b540b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gce/startup-script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# [START startup]
16-
set -v
16+
set -ve
1717

1818

1919
# Talk to the metadata server to get the project id
@@ -32,7 +32,7 @@ service google-fluentd restart &
3232
apt-get update
3333
apt-get install -yq ca-certificates git build-essential supervisor
3434

35-
35+
# git requires $HOME and it's not set during the startup script.
3636
# Fetch source code
3737
export HOME=/root
3838
git clone https://github.com/GoogleCloudPlatform/nodejs-getting-started.git /opt/app

0 commit comments

Comments
 (0)