Skip to content
Open
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
11 changes: 5 additions & 6 deletions scripts/docker-build
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set -o errexit && set -o nounset may be a bit more readable.


# Build Dockerfile from clean git repo instead of working copy to prevent
# mistakes with working copy being copied to docker image.
Expand Down Expand Up @@ -43,10 +44,8 @@ fi
# That's image for https://hub.docker.com/r/openobservatory/
img="openobservatory/$img_slug"

ver="$1"
if [ -z "$ver" ]; then
ver="$(date '+%Y%m%d')"
fi
ver="$(date '+%Y%m%d')"
ver="${1:-$ver}"
ver="${ver}-${git_head8}" # tags in git repo are not used, so HEAD is stored as image version

if [ -n "$(git status --short .)" ]; then
Expand All @@ -56,7 +55,7 @@ if [ -n "$(git status --short .)" ]; then
fi

echo "Going to build $img:$ver & $img:latest"
read -p "Press enter to continue, ^C if that's wrong"
#read -p "Press enter to continue, CTRL-c otherwise"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out?


set -o errexit
set -o pipefail
Expand All @@ -67,7 +66,7 @@ set -o pipefail
)

echo "Going to push $img:$ver & $img:latest"
read -p "Press enter to continue, ^C if that's wrong"
read -p "Press enter to continue, CTRL-c otherwise"

for tag in "$img:$ver" "$img:latest"; do (
set -o xtrace
Expand Down