Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
midPoint_container/build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
47 lines (45 sloc)
1.32 KB
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
#!/bin/bash | |
cd "$(dirname "$0")" | |
source common.bash | |
SKIP_DOWNLOAD=0 | |
REFRESH="" | |
while getopts "nhr?" opt; do | |
case $opt in | |
n) | |
SKIP_DOWNLOAD=1 | |
;; | |
r) | |
result=$(docker ps -a | grep $maintainer/$imagename:$tag) | |
if [ ! -z "$result" ]; then | |
echo "Cleaning up $maintainer/$imagename:$tag..." | |
docker rm -f $(docker ps -a | grep $maintainer/$imagename:$tag | awk '{print $1}') | |
docker rmi -f $maintainer/$imagename:$tag | |
echo "Done" | |
fi | |
REFRESH="--no-cache --pull" | |
echo "Using 'refresh' mode: $REFRESH" | |
;; | |
h | ?) | |
echo "Options: -n skip download" | |
exit 0 | |
;; | |
*) | |
echo "Unknown option: $opt" | |
exit 1 | |
;; | |
esac | |
done | |
if [ "$SKIP_DOWNLOAD" = "0" ]; then ./download-midpoint || exit 1; fi | |
docker build $REFRESH --tag $maintainer/$imagename:$tag --build-arg maintainer=$maintainer --build-arg imagename=$imagename . || exit 1 | |
echo "---------------------------------------------------------------------------------------" | |
echo "The midPoint containers were successfully built. To start them, execute the following:" | |
echo "" | |
echo "(for simple demo)" | |
echo "" | |
echo "$ cd" $(pwd)/demo/simple | |
echo "$ docker-compose up" | |
echo "" | |
echo "(for complex demo)" | |
echo "" | |
echo "$ cd" $(pwd)/demo/complex | |
echo "$ docker-compose up --build" |