Skip to content

Commit 3056cd9

Browse files
committed
fix(build.sh): fail on errors in Dockerfile two-tier builds
Without "set -e" at the top of each build.sh script, errors would not propagate to the parent "docker build" process. In the case of controller, this was masking a missing dependency which is now fixed.
1 parent ff24fad commit 3056cd9

6 files changed

Lines changed: 30 additions & 12 deletions

File tree

cache/image/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
4-
echo
7+
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the cache locally"
6-
echo
9+
echo
710
exit 1
811
fi
912

controller/build.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
47
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the controller locally"
@@ -13,7 +16,7 @@ DEBIAN_FRONTEND=noninteractive
1316
# HACK: install git so we can install bacongobbler's fork of django-fsm
1417
# install openssh-client for temporary fleetctl wrapper
1518
apt-get update && \
16-
apt-get install -yq python-dev libpq-dev libyaml-dev git
19+
apt-get install -yq python-dev libffi-dev libpq-dev libyaml-dev git
1720

1821
# install pip
1922
curl -sSL https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | python -
@@ -32,8 +35,8 @@ mkdir -p /templates && chown -R deis:deis /templates
3235
pip install -r /app/requirements.txt
3336

3437
# cleanup. indicate that python, libpq and libyanl are required packages.
35-
apt-mark unmarkauto python python-openssl libpq5 libpython2.7 libyaml-0-2 && \
36-
apt-get remove -y --purge python-dev gcc cpp libpq-dev libyaml-dev git && \
38+
apt-mark unmarkauto python python-openssl libpq5 libpython2.7 libffi6 libyaml-0-2 && \
39+
apt-get remove -y --purge python-dev gcc cpp libffi-dev libpq-dev libyaml-dev git && \
3740
apt-get autoremove -y --purge && \
3841
apt-get clean -y && \
3942
rm -Rf /usr/share/man /usr/share/doc && \

database/build.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
4-
echo
7+
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the database locally"
6-
echo
9+
echo
710
exit 1
811
fi
912

@@ -49,4 +52,4 @@ apt-mark unmarkauto python curl daemontools file libxml2-dev \
4952
apt-get clean -y && \
5053
rm -Rf /usr/share/man /usr/share/doc && \
5154
rm -rf /tmp/* /var/tmp/* && \
52-
rm -rf /var/lib/apt/lists/*
55+
rm -rf /var/lib/apt/lists/*

registry/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
4-
echo
7+
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the registry locally"
6-
echo
9+
echo
710
exit 1
811
fi
912

router/parent/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
47
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the router locally"

store/base/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env bash
22

3+
# fail on any command exiting non-zero
4+
set -eo pipefail
5+
36
if [[ -z $DOCKER_BUILD ]]; then
4-
echo
7+
echo
58
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the controller locally"
6-
echo
9+
echo
710
exit 1
811
fi
912

0 commit comments

Comments
 (0)