Skip to content
Snippets Groups Projects
Commit 50a14079 authored by Armin Co's avatar Armin Co
Browse files

Added script.

Script to build mumble web.
parent 90d03bec
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Mumble-Web repository
REPOSITORY="mumble-web"
URL_GITHUB="https://github.com/Johni0702/${REPOSITORY}.git"
# name of the image which will be build
IMAGE_NAME="build_mumble_web_image"
# name of the temporarily created container
CONTAINER_NAME="build_mumble_web_container"
# path to the directorie "dist" in the image
DIST_DIR="/home/node/dist"
# path on the host where to copy the files
DESTINATION_HOST="./dist"
# check if git repository is already cloned
# then pull updates
# if not clone repository
if cd $REPOSITORY
then
git pull
cd ../
else
git clone $URL_GITHUB
fi
# build docker image
docker build -t $IMAGE_NAME .
# create temporary container
docker create --name $CONTAINER_NAME "${IMAGE_NAME}"
# copy files from container to host
docker cp $CONTAINER_NAME:"${DIST_DIR}" $DESTINATION_HOST
# remove created container
docker rm -f $CONTAINER_NAME
# remove the created image
# otherwise it would only pull updates
# from other node dependenices
# if there was an update in the repository
docker rmi $IMAGE_NAME
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment