Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set -euxE and pipefail for context sh scripts #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions context/run-agent-services.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

set -euxE
set -o pipefail

echo '/run-services.sh'

for entry in /services/*.sh
Expand Down
3 changes: 3 additions & 0 deletions context/run-agent.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

set -euxE
set -o pipefail

check() {
if [[ $? != 0 ]]; then
echo "Error! Stopping the script."
Expand Down
4 changes: 4 additions & 0 deletions context/run-docker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

set -euxE
set -o pipefail


if [ "$DOCKER_IN_DOCKER" = "start" ] ; then

# Do cover the case when the container is restarted:
Expand Down
4 changes: 3 additions & 1 deletion context/run-server-services.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

# Fail if one of the service scripts fail
set -e
set -euxE
set -o pipefail

echo '/run-services.sh'

Expand Down
5 changes: 4 additions & 1 deletion context/run-server.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

set -euxE
set -o pipefail

# Setting default values if variables not present
: ${TEAMCITY_DIST:=/opt/teamcity}
: ${TEAMCITY_LOGS:=${TEAMCITY_DIST}/logs}
Expand Down Expand Up @@ -27,4 +30,4 @@ cd "${TEAMCITY_DIST}"
echo "TeamCity server.xml parameter: $TEAMCITY_SERVER_XML"
bin/teamcity-server.sh run $TEAMCITY_SERVER_XML &
wait $!
exit $?
exit $?