Skip to content

Commit 94374e5

Browse files
fredrectensorflower-gardener
authored andcommitted
Make CI scripts more strict
PiperOrigin-RevId: 415259014
1 parent 27578aa commit 94374e5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ci/kokoro/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# Fail on any error.
18-
set -e
17+
# Make Bash more strict, for easier debugging.
18+
set -e # Exit on the first error.
19+
set -u # Treat unset variables as error.
20+
set -o pipefail # Treat the failure of a command in a pipeline as error.
1921

2022
# Display commands being run.
2123
# WARNING: please only enable 'set -x' if necessary for debugging, and be very

ci/kokoro/gcp_ubuntu/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020

2121
# TODO(b/185727163): switch to prebuilt Docker image to speed this up.
2222

23-
# Fail on any error.
24-
set -e
23+
# Make Bash more strict, for easier debugging.
24+
set -e # Exit on the first error.
25+
set -u # Treat unset variables as error.
26+
set -o pipefail # Treat the failure of a command in a pipeline as error.
2527

2628
# Display commands being run.
2729
# WARNING: please only enable 'set -x' if necessary for debugging, and be very

0 commit comments

Comments
 (0)