418480bff5
build.sh replaces docker-compose as an image build tool. Instead, all OpenSlides services can be built using this script which offers various important options such as tagging and configurable defaults. The now-redundant build instructions have been removed from the YAML templates. The almost identical server and client build scripts have been made fully identical.
20 lines
508 B
Bash
Executable File
20 lines
508 B
Bash
Executable File
#!/bin/bash
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
service_name="$(basename "$PWD")"
|
|
version_file="docker/${service_name}-version.txt"
|
|
|
|
{
|
|
printf "${service_name^} built on %s:\n\n" "$(date)"
|
|
printf "Branch: %s\n" "$(git rev-parse --abbrev-ref HEAD)"
|
|
printf '\n'
|
|
git show -s --format=raw
|
|
} > "$version_file"
|
|
|
|
docker build --tag "${img:-openslides/openslides-${service_name}:latest}" \
|
|
--pull "${OPTIONS[@]}" -f docker/Dockerfile .
|
|
|
|
rm "$version_file" || true
|
|
unset version_file
|
|
unset service_name
|