From c6b540868f1b3d21ec3222990f5aa6bd6e770aed Mon Sep 17 00:00:00 2001 From: "mathieu.brunot" Date: Sun, 23 Jun 2019 18:47:33 +0200 Subject: [PATCH] :construction: Helper script to prepare back dist Signed-off-by: mathieu.brunot --- backend/scripts/prepare-release.sh | 9 +++++++-- manage.sh | 31 +++++++++++------------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/backend/scripts/prepare-release.sh b/backend/scripts/prepare-release.sh index a247728c1..5cc12247f 100644 --- a/backend/scripts/prepare-release.sh +++ b/backend/scripts/prepare-release.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -rm -rf ../dist || exit 1; +if [ ! -d "$1" ] || [ ! -d "$2" ]; then + echo "Expecting path to backend and destination directory" + exit 1 +fi + +rm -rf $2 || exit 1; rsync -avr \ --exclude="/test" \ @@ -7,4 +12,4 @@ rsync -avr \ --exclude="/target" \ --exclude="/scripts" \ --exclude="/.*" \ - ../ ../dist/; + $1 $2; diff --git a/manage.sh b/manage.sh index 9a8e2abfa..9fbb18321 100755 --- a/manage.sh +++ b/manage.sh @@ -128,26 +128,17 @@ function build-release-frontend { } function build-release-backend-local { - #if ! $(docker images | grep $IMGNAME | grep -q $REV); then - # build-devenv - #fi - #mkdir -p $HOME/.m2 - #CONTAINER=$IMGNAME:latest - #echo "Running development image $CONTAINER to build backend release..." - #docker run -ti --rm \ - # -w /home/uxbox/uxbox/backend \ - # -v `pwd`:/home/uxbox/uxbox \ - # -v $HOME/.m2:/home/uxbox/.m2 \ - # $CONTAINER ./scripts/prepare-release.sh - rm -rf backend/dist || exit 1; - rsync -avr \ - --exclude="/test" \ - --exclude="/resources/public/media" \ - --exclude="/target" \ - --exclude="/scripts" \ - --exclude="/.*" \ - backend/ backend/dist/; -} + echo "Prepare backend release..." + ./backend/scripts/prepare-release.sh backend/ backend/dist/ + #rm -rf backend/dist || exit 1; + #rsync -avr \ + # --exclude="/test" \ + # --exclude="/resources/public/media" \ + # --exclude="/target" \ + # --exclude="/scripts" \ + # --exclude="/.*" \ + # backend/ backend/dist/; +}# function build-release-backend { build-release-backend-local || exit 1;