You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/01/29 18:10:40 UTC

[GitHub] asifdxtreme closed pull request #266: SCB-317 Add release scripts for frontend

asifdxtreme closed pull request #266: SCB-317 Add release scripts for frontend
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/266
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/scripts/release/README.md b/scripts/release/README.md
index 64427c2e..5e6e7dfa 100644
--- a/scripts/release/README.md
+++ b/scripts/release/README.md
@@ -30,4 +30,17 @@ bash -x scripts/release/make_release.sh linux 1.0.0 1.0.0-m1
 bash -x scripts/release/make_release.sh windows 1.0.0 1.0.0-m1
 ```
 
+#### Frontend Linux Release
+
+```
+# bash -x scripts/release/make_frontend_release.sh OS_NAME VERSION_NUMBER PACKAGE_NUMBER
+bash -x scripts/release/make_frontend_release.sh linux 1.0.0 1.0.0-m1
+```
+
+#### Frontend Windows Release
+
+```
+# bash -x scripts/release/make_frontend_release.sh OS_NAME VERSION_NUMBER PACKAGE_NUMBER
+bash -x scripts/release/make_frontend_release.sh windows 1.0.0 1.0.0-m1
+```
 
diff --git a/scripts/release/make_frontend_release.sh b/scripts/release/make_frontend_release.sh
new file mode 100644
index 00000000..c16f9276
--- /dev/null
+++ b/scripts/release/make_frontend_release.sh
@@ -0,0 +1,123 @@
+#!/usr/bin/env bash
+## Get the Release Number
+if [ $2 == "" ]; then
+    echo "Invalid version number....exiting...."
+    exit 1
+else
+    RELEASE=$2
+fi
+
+## Get the PACKAGE NUMBER
+if [ $3 == "" ]; then
+    PACKAGE=RELEASE
+else
+    PACKAGE=$3
+fi
+
+## Get the OS Version
+case $1 in
+ linux )
+    OSNAME=linux ;;
+
+ windows )
+    OSNAME=windows ;;
+
+ all )
+    OSNAME=all ;;
+
+ * )
+    echo "Wrong OS Version....exiting....."
+    exit 1
+
+esac
+
+## Prepare the Configuration
+prepare_conf() {
+    set +e
+    rm -rf tmp
+
+    set -e
+    mkdir tmp
+    cp -r frontend/conf tmp/
+}
+
+# Build Linux Release
+build_linux(){
+    if [ $RELEASE == "" ] ; then
+         echo "Error in Making Linux Release.....Release Number not specified"
+    fi
+    if [ $PACKAGE = "" ]; then
+        echo "Error in Making Linux Release.....Package Number not specified"
+    fi
+
+    set +e
+    rm -rf frontend-servicecomb-service-center-$PACKAGE-linux-amd64
+    rm -rf frontend-servicecomb-service-center-$PACKAGE-linux-amd64.tar.gz
+
+    set -e
+    mkdir -p frontend-servicecomb-service-center-$PACKAGE-linux-amd64
+
+    export GOOS=linux
+    cd frontend
+    go build -o scfrontend
+    cp -r scfrontend ../frontend-servicecomb-service-center-$PACKAGE-linux-amd64
+    cd ..
+    prepare_conf
+    cp -r tmp/conf frontend-servicecomb-service-center-$PACKAGE-linux-amd64/
+    cp -r frontend/app frontend-servicecomb-service-center-$PACKAGE-linux-amd64/
+    echo "./scfrontend > start-sc-frontend.log 2>&1 &" >> frontend-servicecomb-service-center-$PACKAGE-linux-amd64/start.sh
+    echo "kill -9 \$(ps aux | grep 'scfrontend' | awk '{print \$2}')" >> frontend-servicecomb-service-center-$PACKAGE-linux-amd64/stop.sh
+    chmod +x frontend-servicecomb-service-center-$PACKAGE-linux-amd64/start.sh
+    chmod +x frontend-servicecomb-service-center-$PACKAGE-linux-amd64/stop.sh
+    cp -r LICENSE frontend-servicecomb-service-center-$PACKAGE-linux-amd64/
+    cp -r NOTICE frontend-servicecomb-service-center-$PACKAGE-linux-amd64/
+    cp -r DISCLAIMER frontend-servicecomb-service-center-$PACKAGE-linux-amd64/
+    cp -r frontend/Readme.md frontend-servicecomb-service-center-$PACKAGE-linux-amd64/
+    tar -czvf frontend-servicecomb-service-center-$PACKAGE-linux-amd64.tar.gz frontend-servicecomb-service-center-$PACKAGE-linux-amd64
+
+}
+
+# Build Windows Release
+build_windows(){
+    if [ $RELEASE == "" ] ; then
+         echo "Error in Making Windows Release.....Release Number not specified"
+    fi
+    if [ $PACKAGE = "" ]; then
+        echo "Error in Making Windows Release.....Package Number not specified"
+    fi
+
+    set +e
+    rm -rf frontend-servicecomb-service-center-$PACKAGE-windows-amd64
+    rm -rf frontend-servicecomb-service-center-$PACKAGE-windows-amd64.zip
+
+    set -e
+    mkdir -p frontend-servicecomb-service-center-$PACKAGE-windows-amd64
+    export GOOS=windows
+    cd frontend
+    go build -o scfrontend.exe
+    cp -r scfrontend.exe ../frontend-servicecomb-service-center-$PACKAGE-windows-amd64
+    cd ..
+    prepare_conf
+    cp -r tmp/conf frontend-servicecomb-service-center-$PACKAGE-windows-amd64/
+    cp -r frontend/app frontend-servicecomb-service-center-$PACKAGE-windows-amd64/
+    cp -r LICENSE frontend-servicecomb-service-center-$PACKAGE-windows-amd64/
+    cp -r NOTICE frontend-servicecomb-service-center-$PACKAGE-windows-amd64/
+    cp -r DISCLAIMER frontend-servicecomb-service-center-$PACKAGE-windows-amd64/
+    cp -r frontend/Readme.md frontend-servicecomb-service-center-$PACKAGE-windows-amd64/
+    echo "scfrontend.exe" >> frontend-servicecomb-service-center-$PACKAGE-windows-amd64/start.bat
+    tar -czvf frontend-servicecomb-service-center-$PACKAGE-windows-amd64.tar.gz frontend-servicecomb-service-center-$PACKAGE-windows-amd64
+}
+
+## Compile the binary
+case $OSNAME in
+ linux )
+    build_linux ;;
+
+ windows )
+    build_windows ;;
+
+ all )
+    build_linux
+    build_windows ;;
+
+esac


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services