Skip to content

Commit

Permalink
Various buildbuilder tweaks:
Browse files Browse the repository at this point in the history
- check for $NO_CACHE in the environment
- specify the $RANDOM build arg (to always pull the latest osg-build from git)
- set -x to print the expanded `docker build` command
  • Loading branch information
matyasselmeci committed Jan 11, 2024
1 parent d517b84 commit 3a137b3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions buildbuilder
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

no_cache=
if [[ $NO_CACHE ]]; then
no_cache=--no-cache
fi
squash=--squash
if [[ $NO_SQUASH ]]; then
squash=
Expand All @@ -10,11 +14,16 @@ fi
: "${OSG_BUILD_BRANCH:=master}"
: "${DOCKER:=docker}"

exec "${DOCKER}" build \
git_describe=$(git describe --tags --always --dirty)

set -x
"${DOCKER}" build \
$no_cache \
--build-arg=OSG_BUILD_REPO="${OSG_BUILD_REPO}" \
--build-arg=OSG_BUILD_BRANCH="${OSG_BUILD_BRANCH}" \
--build-arg=RANDOM="${RANDOM}" \
--tag "${OSG_BUILD_IMAGE}" \
--label git.describe="$(git describe --tags --always --dirty)" \
--label git.describe="$git_describe" \
$squash \
-f Dockerfile \
"$@"

0 comments on commit 3a137b3

Please sign in to comment.