Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gestioCOF
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 76
    • Issues 76
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Klub Dev ENSKlub Dev ENS
  • gestioCOF
  • Merge requests
  • !293

Make provisioning script stop immediately on errors

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Basile Clement requested to merge elarnon/bash_set_e into master Feb 11, 2018
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 2

By default, bash will ignore any failing commands and happily proceed to execute the next ones. This is usually not the behavior the we want in provisioning script (or ever in scripts, actually): if one step of the provisioning fails, it doesn't make much sense to proceed with the following ones.

This simple patch uses set -e to ask bash to abort the whole script if any command within it fails, leading to outputs that are easier to parse since the commands following a failing one will usually fail also, hiding the root cause.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: elarnon/bash_set_e