Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Mumble Web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Co
Mumble Web
Commits
e6e42ba0
Verified
Commit
e6e42ba0
authored
Jun 19, 2020
by
Armin Co
Browse files
Options
Downloads
Patches
Plain Diff
Use multistage Dockerfile
for building the mumble-web application to ./dist
parent
9d62f10d
Branches
Branches containing commit
No related tags found
1 merge request
!1
Feature nginx.
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
build_mumble_web.sh
+12
-21
12 additions, 21 deletions
build_mumble_web.sh
with
12 additions
and
21 deletions
build_mumble_web.sh
+
12
−
21
View file @
e6e42ba0
...
@@ -29,10 +29,6 @@ CONTAINER_NAME="build_mumble_web_container"
...
@@ -29,10 +29,6 @@ CONTAINER_NAME="build_mumble_web_container"
DIST_DIR
=
"/home/node/dist"
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"
# select if create image should be removed
DELETE_IMAGE
=
"false"
# Run test with container
RUN_TEST
=
"true"
function
verify_commit_HEAD
()
{
function
verify_commit_HEAD
()
{
cd
$REPOSITORY
cd
$REPOSITORY
...
@@ -40,14 +36,19 @@ function verify_commit_HEAD() {
...
@@ -40,14 +36,19 @@ function verify_commit_HEAD() {
cd
../
cd
../
}
}
echo
"buildung mumble-web"
echo
"files will be stored at:
${
DESTINATION_HOST
}
"
# check if git repository is already cloned
# check if git repository is already cloned
# then pull updates
# then pull updates
# if not clone repository
# if not clone repository
if
cd
$REPOSITORY
if
cd
$REPOSITORY
then
then
echo
"updating mumble-web repository"
git pull
git pull
cd
../
cd
../
else
else
echo
"cloning mumble-web repository"
git clone
$URL_GITHUB
git clone
$URL_GITHUB
fi
fi
...
@@ -55,25 +56,15 @@ fi
...
@@ -55,25 +56,15 @@ fi
verify_commit_HEAD
verify_commit_HEAD
# build docker image
# build docker image
printf
"
\n
Building image
\n
"
echo
"building mumble-web image"
docker build
-t
$IMAGE_NAME
-f
Dockerfile.mumble-web
.
>
build.log
echo
"logs will be stored in: build.log"
time
docker build
--target
mumble-web
-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
# remove previously copied files
rm
-rf
dist
/
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
docker
rm
-f
$CONTAINER_NAME
docker
rm
-f
$CONTAINER_NAME
if
[
$DELETE_IMAGE
==
"true"
]
then
# remove the created image
docker rmi
$IMAGE_NAME
docker rmi
$IMAGE_NAME
\ No newline at end of file
fi
if
[
$RUN_TEST
==
"true"
]
then
docker build
-t
"
${
IMAGE_NAME
}
_nginx"
-f
webserver/Dockerfile.nginx
.
docker run
--rm
-d
-p
443:443
--name
"
${
CONTAINER_NAME
}
_nginx"
"
${
IMAGE_NAME
}
_nginx"
fi
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment