Skip to content

Commit

Permalink
#284 Add build hook (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj authored Apr 18, 2022
1 parent da9d674 commit 937fd64
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

echo "==========================================================="
echo "== stream-loader/hooks/build"
echo "== Building with file: $DOCKERFILE_PATH"
echo "== Environment variables:"
env | sort | awk -F= '{ print "== ", $0}'
echo "==========================================================="

# Build with data.

if [ ${DOCKERFILE_PATH} == "Dockerfile-with-data" ]; then

# Build from staging with data.

if [ -z ${SENZING_APT_REPOSITORY_URL} ]; then
echo "Build from staging with data."
docker build \
--build-arg SENZING_ACCEPT_EULA=${SENZING_ACCEPT_EULA} \
--build-arg SENZING_APT_REPOSITORY_URL=${SENZING_APT_REPOSITORY_URL} \
--file ${DOCKERFILE_PATH} \
--tag ${IMAGE_NAME} \
.

# Default build with data.

else
echo "Build from production with data."
docker build \
--build-arg SENZING_ACCEPT_EULA=${SENZING_ACCEPT_EULA} \
--file ${DOCKERFILE_PATH} \
--tag ${IMAGE_NAME} \
.
fi

# Default build with no data.

else
echo "Build from production."
docker build \
--file ${DOCKERFILE_PATH} \
--tag ${IMAGE_NAME} \
.
fi

0 comments on commit 937fd64

Please sign in to comment.