hard20 pts · first answer countsshell-scriptingci-cd
set -e does not stop the script
This script runs with set -euo pipefail, yet when fetch_token fails the script keeps going and deploys with an empty token. Why?
set -euo pipefail
get_token() {
local token=$(fetch_token)
echo "$token"
}
TOKEN=$(get_token)
./deploy.sh --token "$TOKEN"Discussion 0
Join free to post in the discussion.
Related questions
- CI vs Continuous DeliveryDevOps Engineer
- What set -euo pipefail doesDevOps Engineer
- Where GitHub Actions workflows liveDevOps Engineer
- GitLab CI stagesDevOps Engineer
- Why keep a Jenkinsfile in the repoDevOps Engineer
- Parking unfinished changesDevOps Engineer
- Copying one fix to a release branchDevOps Engineer
- Version bump for a breaking changeDevOps Engineer