You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wubloader/build

31 lines
740 B
Bash

#!/bin/bash
set -eu
# Builds the docker images.
# Usage: ./build {COMPONENTS}, or just ./build to build all.
# The resulting images are named wubloader-COMPONENT.
# The different images we can build
COMPONENTS=(downloader restreamer)
# The docker image tag, derived from the git commit + whether working tree is clean
TAG=$(git rev-parse --short HEAD)
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
TAG="$TAG-wip"
fi
if [ "$#" -gt 0 ]; then
COMPONENTS=("$@")
fi
for component in "${COMPONENTS[@]}"; do
echo "Building image for $component"
docker build \
-f "$component/Dockerfile" \
-t "wubloader-$component:latest" \
-t "wubloader-$component:$TAG" \
.
echo "Built image wubloader-$component:$TAG"
done