-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor build scripts and Docker image
- Loading branch information
1 parent
40ee76e
commit a64f848
Showing
4 changed files
with
62 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash -x | ||
set -eu -o pipefail | ||
|
||
############################################################# | ||
# Any function offered by this file assume that the path is # | ||
# located at the root of repository classroom-demo # | ||
############################################################# | ||
|
||
# CI flags | ||
BUILD_FRONT=false | ||
BUILD_BACK=false | ||
|
||
# Environment variables | ||
if [[ -n ${1:-} ]]; then | ||
case "${1:-}" in | ||
--build-front) | ||
BUILD_FRONT=true | ||
;; | ||
--build-back) | ||
BUILD_BACK=true | ||
;; | ||
*) | ||
echo "Unrecognized method $1" | ||
exit 1 | ||
;; | ||
esac | ||
else | ||
echo "Must provide a method to execute as first parameter when calling the script" | ||
exit 1 | ||
fi | ||
|
||
# ------------- | ||
# Build front | ||
# ------------- | ||
if [[ "${BUILD_FRONT}" == true ]]; then | ||
rm -rf src/main/resources/static/* | ||
cd src/angular/frontend | ||
npm install --force | ||
npx ng build --output-path ../../../src/main/resources/static | ||
fi | ||
|
||
# ------------- | ||
# Build back | ||
# ------------- | ||
if [[ "${BUILD_BACK}" == true ]]; then | ||
mvn clean compile package | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#!/bin/bash | ||
if [ $# -eq 0 ]; then | ||
echo "No version argument provided. Usage: \"./create_image.sh <IMAGE_NAME>\"" | ||
exit 1 | ||
fi | ||
|
||
pushd ../ | ||
#!/bin/bash -x | ||
|
||
docker build -f docker/Dockerfile -t "$1" . | ||
VERSION=$1 | ||
if [[ ! -z $VERSION ]]; then | ||
cd .. | ||
docker build --pull --no-cache --rm=true -f docker/Dockerfile -t openvidu/openvidu-classroom-demo:$VERSION . | ||
else | ||
echo "Error: You need to specify a version as first argument" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters