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
48 lines (46 sloc)
1.44 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" | |
echo " -r refresh mode: uses --no-cache --pull and removes container and image before build" | |
exit 0 | |
;; | |
*) | |
echo "Unknown option: $opt" | |
exit 1 | |
;; | |
esac | |
done | |
if [ "$SKIP_DOWNLOAD" = "0" ]; then ./download-midpoint.sh || 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 Grouper integration demo)" | |
echo "" | |
echo "$ cd" $(pwd)/demo/grouper | |
echo "$ docker-compose up --build" |