Skip to content
Snippets Groups Projects
Verified Commit 10c55813 authored by Armin Co's avatar Armin Co
Browse files

Save image build log into build.log

parent 5fb15d6d
Branches
No related tags found
No related merge requests found
dist/
mumble-web/
\ No newline at end of file
mumble-web/
*.log
\ No newline at end of file
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment