-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #82 Remove Docker images when a configuration is tested
- Loading branch information
Showing
8 changed files
with
145 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
# | ||
# Generated by CAMP. Edit carefully\n" | ||
# | ||
# Build all images and set the appropriate tags\n" | ||
# | ||
|
||
set -e | ||
|
||
BUILD=false | ||
CLEANUP=false | ||
|
||
parse_arguments () { | ||
while [ $# -gt 0 ]; do | ||
case "$1" in | ||
-b|--build) | ||
BUILD="true" | ||
shift 1 | ||
;; | ||
-c|--cleanup) | ||
CLEANUP="true" | ||
shift 1 | ||
;; | ||
*) | ||
printf "Error: Unknown option '$1'.\n" | ||
printf "${USAGE}\n" | ||
exit 1 | ||
esac | ||
done | ||
|
||
} | ||
|
||
|
||
# Remove the obselete images created for this configuration | ||
# See Issue #82 | ||
remove_obselete_images () { | ||
docker rmi {obselete_images} | ||
docker image prune --force --filter "label=stage=intermediate" | ||
} | ||
|
||
|
||
build_images () { | ||
{build_commands} | ||
} | ||
|
||
|
||
# Script entry point | ||
|
||
parse_arguments $* | ||
|
||
if [[ "${BUILD}" == "true" ]] | ||
then | ||
printf "building images\n" | ||
build_images | ||
else | ||
if [[ "${CLEANUP}" == "true" ]] | ||
then | ||
printf "Cleaning up\n" | ||
remove_obselete_images | ||
fi | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
# Step 1: Build the WAR file | ||
FROM openjdk:8-jdk-stretch as builder | ||
|
||
LABEL maintainer "[email protected]" | ||
LABEL maintainer="[email protected]" | ||
LABEL stage="intermediate" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters