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
No related branches found
No related tags found
No related merge requests found
dist/ dist/
mumble-web/ mumble-web/
*.log
\ No newline at end of file
...@@ -12,6 +12,11 @@ DIST_DIR="/home/node/dist" ...@@ -12,6 +12,11 @@ DIST_DIR="/home/node/dist"
# path on the host where to copy the files # path on the host where to copy the files
DESTINATION_HOST="./dist" DESTINATION_HOST="./dist"
function verify_commit_HEAD() {
cd $REPOSITORY
git verify-commit -v HEAD
cd ../
}
# check if git repository is already cloned # check if git repository is already cloned
# then pull updates # then pull updates
...@@ -19,20 +24,21 @@ DESTINATION_HOST="./dist" ...@@ -19,20 +24,21 @@ DESTINATION_HOST="./dist"
if cd $REPOSITORY if cd $REPOSITORY
then then
git pull git pull
git verify-commit -v HEAD
cd ../ cd ../
else else
git clone $URL_GITHUB git clone $URL_GITHUB
cd $REPOSITORY
git verify-commit -v HEAD
cd ../
fi fi
# print verify-commit output
verify_commit_HEAD
# build docker image # build docker image
docker build -t $IMAGE_NAME . printf "\nBuilding image\n"
docker build -t $IMAGE_NAME . > build.log
# create temporary container # create temporary container
docker create --name $CONTAINER_NAME "${IMAGE_NAME}" docker create --name $CONTAINER_NAME "${IMAGE_NAME}"
# remove previously copied files
rm -rf dist/
# copy files from container to host # copy files from container to host
docker cp $CONTAINER_NAME:"${DIST_DIR}" $DESTINATION_HOST docker cp $CONTAINER_NAME:"${DIST_DIR}" $DESTINATION_HOST
# remove created container # remove created container
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment