Skip to content
Permalink
ace32da8f3
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 28 lines (23 sloc) 671 Bytes
#!/usr/bin/env bash
echo "[INFO] $0 started at $(date)"
# Read the commit hash
read -r COMMIT_HASH<<<"$(git rev-parse --short HEAD)"
if [ -z "$COMMIT_HASH" ]; then
echo "[ERROR] Couldn't read commit hash"
exit 1
fi
echo "[INFO] Commit hash: \"$COMMIT_HASH\""
IMAGES=( shib-test-idp test-ldap )
for IMAGE in ${IMAGES[*]}; do
echo "[INFO] Building $IMAGE"
cd containers/"$IMAGE" || exit 1
docker build --pull --quiet --tag "$IMAGE":latest \
--tag "$IMAGE":"$COMMIT_HASH" .
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "[ERROR] Building $IMAGE failed (exit code $EXIT_CODE)"
exit 1
fi
cd ../..
done
echo "[INFO] $0 finished at $(date)"