Index: local/run.vend.patch.sh =================================================================== diff -u -r23d228183fb3bea51cdefa7979f20345b4198dbd -r2e2f8d68148ca4d89fb8ae3029b72ed8956a6f93 --- local/run.vend.patch.sh (.../run.vend.patch.sh) (revision 23d228183fb3bea51cdefa7979f20345b4198dbd) +++ local/run.vend.patch.sh (.../run.vend.patch.sh) (revision 2e2f8d68148ca4d89fb8ae3029b72ed8956a6f93) @@ -1,5 +1,7 @@ #!/bin/bash +SCRIPT_PATH=$(dirname $(realpath "$0")) +BUILD_NUMBER=$SCRIPT_PATH/build_number.sh CURRNET_DATE=$(date +%Y_%m_%d) CURRENT_GUSER="Behrouz NematiPour" CURRENT_GEMAIL="bNematiPour@diality.com" @@ -15,7 +17,7 @@ function current_branch() { repo_folder="$1" - if [[ -z $repo_folder ]]; then + if [[ -z $repo_folder ]]; then echo "Not a repository." exit 1 fi @@ -31,8 +33,10 @@ function patch_sources() { PASS=$(pwgen -ABcsnv1 16) + build_number="Build-"$(printf "%.2d" $($BUILD_NUMBER)) + cd - DEV_TEST_DIR=$HOME/Diality_Dev_Test_$CURRNET_DATE + DEV_TEST_DIR=$HOME/Diality_Dev_Test_$CURRNET_DATE"_"$build_number rsync -Lr --exclude=".*" --exclude="*.log" --exclude="*.err" --exclude="*.swp" $APPICATION_SOURCE $DEV_TEST_DIR cd $DEV_TEST_DIR @@ -102,6 +106,10 @@ read -p "Continue?" +if [[ "$1" == "--reset" ]]; then + $BUILD_NUMBER -- $2 +fi + if [[ "$1" == "--source" ]]; then patch_sources fi @@ -121,6 +129,8 @@ if [[ "$1" == "" ]]; then echo "Usage:" echo "./run.vend.patch