Add -euo pipefail to TF pipelines in `testing` (#2583)
Prototype fix. Part of #2441.
(dupe of #2582)
diff --git a/buildkite/terraform/bazel-testing/pipelines_bazel.tf b/buildkite/terraform/bazel-testing/pipelines_bazel.tf
index 7df3bf9..d689ee4 100644
--- a/buildkite/terraform/bazel-testing/pipelines_bazel.tf
+++ b/buildkite/terraform/bazel-testing/pipelines_bazel.tf
@@ -61,7 +61,7 @@
envs = {}
steps = {
commands = [
- "curl -s \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/pipelines/publish-bazel-binaries.yml?$(date +%s)\" | tee /dev/tty | buildkite-agent pipeline upload --replace"
+ "set -euo pipefail; curl -s \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/pipelines/publish-bazel-binaries.yml?$(date +%s)\" | tee /dev/tty | buildkite-agent pipeline upload --replace"
]
}
})
@@ -88,7 +88,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py bazel_downstream_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py bazel_downstream_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -112,7 +112,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py bazel_downstream_pipeline --file_config=.bazelci/build_bazel_binaries.yml --test_disabled_projects | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py bazel_downstream_pipeline --file_config=.bazelci/build_bazel_binaries.yml --test_disabled_projects | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -138,7 +138,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py bazel_downstream_pipeline --file_config=.bazelci/build_bazel_binaries.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py bazel_downstream_pipeline --file_config=.bazelci/build_bazel_binaries.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -161,7 +161,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --file_config=.bazelci/config.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --file_config=.bazelci/config.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -185,7 +185,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --file_config=.bazelci/presubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --file_config=.bazelci/presubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -213,7 +213,7 @@
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/collect_metrics.py?$(date +%s)\" -o collect_metrics.py",
- "python3 bazelci.py project_pipeline --file_config=.bazelci/postsubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --file_config=.bazelci/postsubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -313,7 +313,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/pipelines/bazel-linux-arm64.yml?$(date +%s) | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/pipelines/bazel-linux-arm64.yml?$(date +%s) | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -363,7 +363,7 @@
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/collect_metrics.py?$(date +%s)\" -o collect_metrics.py",
"python3 -m pip install --upgrade pip setuptools wheel",
"python3 -m pip install google-cloud-bigquery requests",
- "python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/bazelbuild/bazel/refs/heads/test-metrics/.bazelci/postsubmit.yml | tee /dev/tty | buildkite-agent pipeline upload",
+ "set -euo pipefail; python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/bazelbuild/bazel/refs/heads/test-metrics/.bazelci/postsubmit.yml | tee /dev/tty | buildkite-agent pipeline upload",
]
}
})
diff --git a/buildkite/terraform/bazel-testing/pipelines_misc.tf b/buildkite/terraform/bazel-testing/pipelines_misc.tf
index db0a9b8..206cf64 100644
--- a/buildkite/terraform/bazel-testing/pipelines_misc.tf
+++ b/buildkite/terraform/bazel-testing/pipelines_misc.tf
@@ -6,7 +6,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -28,7 +28,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/buildkite/pipelines/protobuf-postsubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/buildkite/pipelines/protobuf-postsubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -73,7 +73,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --file_config=.bazelci/aspect.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --file_config=.bazelci/aspect.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -118,7 +118,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --file_config=.bazelci/presubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --file_config=.bazelci/presubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -137,7 +137,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -160,7 +160,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -183,7 +183,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --file_config=bazelci/buildkite-pipeline.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --file_config=bazelci/buildkite-pipeline.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -206,7 +206,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/pipelines/flogger.yml?$(date +%s) | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/pipelines/flogger.yml?$(date +%s) | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -245,7 +245,7 @@
resource "buildkite_pipeline" "test-macos" {
name = "Test macOS"
repository = "https://github.com/bazelbuild/continuous-integration.git"
- steps = "# This default command changes the pipeline of a running build by uploading a configuration file.\n# https://buildkite.com/docs/agent/v3/cli-pipeline\n# For information on different step types, check out the sidebar to the right.\n\nsteps:\n- agents: {queue: macos_arm64}\n command: ['echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['echo \"hello\" | sha1sum']\n label: ':macOS: Test'"
+ steps = "# This default command changes the pipeline of a running build by uploading a configuration file.\n# https://buildkite.com/docs/agent/v3/cli-pipeline\n# For information on different step types, check out the sidebar to the right.\n\nsteps:\n- agents: {queue: macos_arm64}\n command: ['set -euo pipefail; echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['set -euo pipefail; echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['set -euo pipefail; echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['set -euo pipefail; echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['set -euo pipefail; echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['set -euo pipefail; echo \"hello\" | sha1sum']\n label: ':macOS: Test'\n- agents: {queue: macos_arm64}\n command: ['set -euo pipefail; echo \"hello\" | sha1sum']\n label: ':macOS: Test'"
default_branch = "master"
allow_rebuilds = true
cancel_intermediate_builds = false
@@ -289,7 +289,7 @@
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/collect_metrics.py?$(date +%s)\" -o collect_metrics.py",
- "python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/fweikert/bazel/refs/heads/qa/.bazelci/postsubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --http_config=https://raw.githubusercontent.com/fweikert/bazel/refs/heads/qa/.bazelci/postsubmit.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -332,7 +332,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --file_config=.bazelci/android-studio.yml | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --file_config=.bazelci/android-studio.yml | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
diff --git a/buildkite/terraform/bazel-testing/pipelines_rules.tf b/buildkite/terraform/bazel-testing/pipelines_rules.tf
index 66616c2..eb41d3e 100644
--- a/buildkite/terraform/bazel-testing/pipelines_rules.tf
+++ b/buildkite/terraform/bazel-testing/pipelines_rules.tf
@@ -6,7 +6,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -29,7 +29,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -52,7 +52,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -75,7 +75,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -98,7 +98,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -121,7 +121,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -144,7 +144,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/master/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -167,7 +167,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline --monitor_flaky_tests=true | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline --monitor_flaky_tests=true | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})
@@ -190,7 +190,7 @@
steps = {
commands = [
"curl -sS \"https://raw.githubusercontent.com/bazelbuild/continuous-integration/testing/buildkite/bazelci.py?$(date +%s)\" -o bazelci.py",
- "python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
+ "set -euo pipefail; python3 bazelci.py project_pipeline | tee /dev/tty | buildkite-agent pipeline upload"
]
}
})