Skip to content

Commit

Permalink
Add option to force rebuilding images
Browse files Browse the repository at this point in the history
  • Loading branch information
eht16 committed Mar 6, 2022
1 parent 01031a2 commit 6362b27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions builders/README.md
Expand Up @@ -55,6 +55,7 @@ the builds of Geany and Geany-Plugins for the various targets.
[-r|--rebuild-images]
-d, --distro DISTRO Build for target Debian DISTRO (e.g. "bullseye",
can be specified multiple times
-f, --force-rebuild Force rebuilding of immages even if not necessary
-g, --geany Build Geany
--geany-source Path to a Geany source directory (optional, cloned from GIT if missing)
--geany-plugins-source Path to a Geany-Plugins source directory (optional, cloned from GIT if missing)
Expand Down
8 changes: 7 additions & 1 deletion builders/start_build.sh
Expand Up @@ -13,6 +13,7 @@
# [-r|--rebuild-images]
# -d, --distro DISTRO Build for target Debian DISTRO (e.g. "bullseye",
# can be specified multiple times
# -f, --force-rebuild Force rebuilding of immages even if not necessary
# -g, --geany Build Geany
# --geany-source Path to a Geany source directory (optional, cloned from GIT if missing)
# --geany-plugins-source Path to a Geany-Plugins source directory (optional, cloned from GIT if missing)
Expand Down Expand Up @@ -63,7 +64,7 @@ rebuild_image() {
image_date=$(echo "${image_date}" | xargs) # trim leading and trailing whitespace
image_date_seconds=$(date --date="${image_date}" "+%s")
expire_date_seconds=$(date --date="${DOCKER_IMAGE_MAX_AGE_DAYS} days ago" "+%s")
if [ "${image_date_seconds}" -lt "${expire_date_seconds}" ] || [ -n "${DO_IMAGE_REBUILD}" ]; then
if [ "${image_date_seconds}" -lt "${expire_date_seconds}" ] || [ -n "${DO_FORCE_IMAGE_REBUILD}" ]; then
log - "Building image ${image_name} (last build: ${image_date})"
log "${BASE_OUTPUT_DIRECTORY}/docker_image_build_${image_name}_$(date '+%Y_%m_%d_%H_%M_%S').log" \
${DOCKER_CMD} build \
Expand Down Expand Up @@ -219,6 +220,10 @@ parse_command_line_options() {
shift
shift
;;
-f|--force-rebuild)
DO_FORCE_IMAGE_REBUILD=1
shift
;;
-g|--geany)
DO_GEANY=1
shift
Expand Down Expand Up @@ -264,6 +269,7 @@ parse_command_line_options() {
DO_DISTRO=
DO_MINGW64=
DO_IMAGE_REBUILD=
DO_FORCE_IMAGE_REBUILD=
DO_GEANY=
DO_GEANY_PLUGINS=
DO_LOG_TO_STDOUT=
Expand Down

0 comments on commit 6362b27

Please sign in to comment.