diff --git a/.gitignore b/.gitignore index 86ffe6259c1202add7bb880a731d0d4a21848e7c..267d1b1e188665270139ead8c7e31501a21c8277 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ dist/ -mumble-web/ \ No newline at end of file +mumble-web/ +*.log \ No newline at end of file diff --git a/build_mumble_web.sh b/build_mumble_web.sh index f59d5bd5e7f9ce09040af947c288ebd00d7e0196..9b917876ec441005f767dd377eb82a2788a7e50a 100755 --- a/build_mumble_web.sh +++ b/build_mumble_web.sh @@ -12,6 +12,11 @@ DIST_DIR="/home/node/dist" # path on the host where to copy the files DESTINATION_HOST="./dist" +function verify_commit_HEAD() { + cd $REPOSITORY + git verify-commit -v HEAD + cd ../ +} # check if git repository is already cloned # then pull updates @@ -19,20 +24,21 @@ DESTINATION_HOST="./dist" if cd $REPOSITORY then git pull - git verify-commit -v HEAD cd ../ else git clone $URL_GITHUB - cd $REPOSITORY - git verify-commit -v HEAD - cd ../ fi +# print verify-commit output +verify_commit_HEAD # build docker image -docker build -t $IMAGE_NAME . +printf "\nBuilding image\n" +docker build -t $IMAGE_NAME . > build.log # create temporary container docker create --name $CONTAINER_NAME "${IMAGE_NAME}" +# remove previously copied files +rm -rf dist/ # copy files from container to host docker cp $CONTAINER_NAME:"${DIST_DIR}" $DESTINATION_HOST # remove created container