aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2020-12-06 22:28:15 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2020-12-06 22:28:15 -0800
commita6d2a8da1de5245c982b9bd28aa6185fe74ae8a2 (patch)
tree3e3a9306caa6b0c442b72ceddd8358b3d3143cfd /bin
parentdownloads/signature: Update expiration dates (diff)
downloadwww-a6d2a8da1de5245c982b9bd28aa6185fe74ae8a2.tar.gz
www-a6d2a8da1de5245c982b9bd28aa6185fe74ae8a2.tar.bz2
www-a6d2a8da1de5245c982b9bd28aa6185fe74ae8a2.zip
bin: avoid concurrent builds
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build.sh3
-rw-r--r--bin/docker-helper.inc3
2 files changed, 6 insertions, 0 deletions
diff --git a/bin/build.sh b/bin/build.sh
index cbabb60..33c895c 100755
--- a/bin/build.sh
+++ b/bin/build.sh
@@ -5,4 +5,7 @@ source "$(dirname "$0")"/docker-helper.inc
# Incremental builds do not update indexes correctly, so we cannot use them.
# https://github.com/jekyll/jekyll/issues/3411
# https://github.com/jekyll/jekyll/issues/3747
+# By including a container name, we automatically ensure that only one instance is running!
+# We may need to explore extra timeouts in future
+DOCKER_RUN_OPTIONS=( --name "gentoo.sites.www.build" )
docker_run_net_none jekyll build
diff --git a/bin/docker-helper.inc b/bin/docker-helper.inc
index d119afd..2d0e08e 100644
--- a/bin/docker-helper.inc
+++ b/bin/docker-helper.inc
@@ -6,6 +6,7 @@ IMAGE_NAME=docker.gentoo.org/sites/www
IMAGE_TAG=latest
IMAGE=${IMAGE_NAME}:${IMAGE_TAG}
IMAGE_SRC=./
+declare -a DOCKER_RUN_OPTIONS DOCKER_BUILD_OPTIONS
docker_build() {
# Always refresh the image
@@ -14,6 +15,7 @@ docker_build() {
--network=host \
--quiet \
-t "${IMAGE}" \
+ "${DOCKER_BUILD_OPTIONS[@]}" \
"${IMAGE_SRC}"
}
@@ -28,6 +30,7 @@ _docker_run_common() {
-e CONNECTED=false \
-e DEBUG=false \
--volume="${PWD}:/srv/jekyll" \
+ "${DOCKER_RUN_OPTIONS[@]}" \
"$@"
}