svn commit: r1849676 - in /ofbiz/tools/demo-backup/Nicolas: functions.sh old-manual.sh stable-manual.sh trunk.sh

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1849676 - in /ofbiz/tools/demo-backup/Nicolas: functions.sh old-manual.sh stable-manual.sh trunk.sh

nmalin
Author: nmalin
Date: Mon Dec 24 09:03:32 2018
New Revision: 1849676

URL: http://svn.apache.org/viewvc?rev=1849676&view=rev
Log:
Review ofbiz demo run script :
 * add new file to consolidate function for reset svn and remove unnecessary files
 * for old, add download contrast-rO0.jar and branch13.7-demo.patch if not present
 * stop ofbiz before any modification on source code

Added:
    ofbiz/tools/demo-backup/Nicolas/functions.sh   (with props)
Modified:
    ofbiz/tools/demo-backup/Nicolas/old-manual.sh
    ofbiz/tools/demo-backup/Nicolas/stable-manual.sh
    ofbiz/tools/demo-backup/Nicolas/trunk.sh

Added: ofbiz/tools/demo-backup/Nicolas/functions.sh
URL: http://svn.apache.org/viewvc/ofbiz/tools/demo-backup/Nicolas/functions.sh?rev=1849676&view=auto
==============================================================================
--- ofbiz/tools/demo-backup/Nicolas/functions.sh (added)
+++ ofbiz/tools/demo-backup/Nicolas/functions.sh Mon Dec 24 09:03:32 2018
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+resetSvn() {
+    cd $1
+
+    #reset user file modification
+    svn revert -R *
+
+    #remove user adding file not versionned
+    IFS=$'\n'
+    for i in $(svn st | grep ^? |cut -c 9-); do rm -fr "$i"; done;
+    if [ -n "$(svn st | grep ^?)" ]; then
+        # this to remove all unsupported file name like C:/ created and not cover by previous command
+        for i in $(svn st | grep ^? |cut -c 9-); do
+            rename_file = "$(echo $i| sed s/[:\\\ ]/_/g)";
+            mv "$i" "$rename_file";
+            rm "$rename_file";
+        done;
+    fi
+}
+
+#remove unecessary config for demo
+removeUneededFiles() {
+    cd $1
+
+    if [ -n "$(ls $OFBIZ_DIR/framework/base/config/*)" ]; then
+        rm $OFBIZ_DIR/framework/base/config/*.jks
+    fi
+    if [ -r "$OFBIZ_DIR/framework/base/config/jesse.properties" ]; then
+        rm $OFBIZ_DIR/framework/base/config/jesse.properties
+    fi
+}
\ No newline at end of file

Propchange: ofbiz/tools/demo-backup/Nicolas/functions.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/tools/demo-backup/Nicolas/functions.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: ofbiz/tools/demo-backup/Nicolas/functions.sh
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/tools/demo-backup/Nicolas/functions.sh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/tools/demo-backup/Nicolas/old-manual.sh
URL: http://svn.apache.org/viewvc/ofbiz/tools/demo-backup/Nicolas/old-manual.sh?rev=1849676&r1=1849675&r2=1849676&view=diff
==============================================================================
--- ofbiz/tools/demo-backup/Nicolas/old-manual.sh (original)
+++ ofbiz/tools/demo-backup/Nicolas/old-manual.sh Mon Dec 24 09:03:32 2018
@@ -1,38 +1,29 @@
 #!/bin/bash
+. "functions.sh"
 
 OFBIZ_DIR="/home/ofbizDemo/branch13.7"
 cd $OFBIZ_DIR
 
+#Stop and clean OFBiz
+./ant stop -Dportoffset=20000
+./ant clean-all
+
 #update source code
+resetSvn $OFBIZ_DIR
 svn up
 
-#reset user file modification
-svn revert -R *
+removeUneededFiles $OFBIZ_DIR
 
-#remove user adding file not versionned
- # branch13.7-demo.patch should not be removed
- # IFS=$'\n'
- # for i in $(svn st | grep ^? |cut -c 9-); do rm -fr "$i"; done;
- # if [ -n "$(svn st | grep ^?)" ]; then
- this to remove all unsupported file name like C:/ created and not cover by previous command
- # for i in $(svn st | grep ^? |cut -c 9-); do
- # rename_file = "$(echo $i| sed s/[:\\\ ]/_/g)";
- # mv "$i" "$rename_file";
- # rm "$rename_file";
- # done;
- # fi
-
-#remove unecessary config for demo
-if [ -n "$(ls $OFBIZ_DIR/framework/base/config/*)" ]; then
-    rm $OFBIZ_DIR/framework/base/config/*.jks
+#check if contrast-rO0.jar is present and apply
+if [ ! -r "contrast-rO0.jar" ]; then
+    wget -q https://svn.apache.org/repos/asf/ofbiz/branches/release15.12/tools/demo-backup/contrast-rO0.jar
 fi
-if [ -r "$OFBIZ_DIR/framework/base/config/jesse.properties" ]; then
-    rm $OFBIZ_DIR/framework/base/config/jesse.properties
+if [ ! -r "branch13.7-demo.patch" ]; then
+    wget https://svn.apache.org/repos/asf/ofbiz/tools/demo-backup/branch13.7-demo.patch
+    patch -p0 < branch13.7-demo.patch
 fi
 
-#Stop, clean and run OFBiz
-./ant stop -Dportoffset=20000
-./ant clean-all
+#Load Data and run OFBiz
 ./ant load-demo
 ./ant svninfo
 ./ant start-batch-secure -Dportoffset=20000

Modified: ofbiz/tools/demo-backup/Nicolas/stable-manual.sh
URL: http://svn.apache.org/viewvc/ofbiz/tools/demo-backup/Nicolas/stable-manual.sh?rev=1849676&r1=1849675&r2=1849676&view=diff
==============================================================================
--- ofbiz/tools/demo-backup/Nicolas/stable-manual.sh (original)
+++ ofbiz/tools/demo-backup/Nicolas/stable-manual.sh Mon Dec 24 09:03:32 2018
@@ -1,38 +1,22 @@
 #!/bin/bash
+. "functions.sh"
+
 OFBIZ_DIR = "/home/ofbizDemo/branch16.11"
 echo "This can't be used alone, see OFBIZ-10287. You need for now to use all-manual-nicely.sh";
 
 cd $OFBIZ_DIR
 
+# Stop, clean and run OFBiz
+./gradlew --no-daemon "ofbiz --shutdown --portoffset 10000"
+./gradlew --no-daemon cleanAll
+
 #update source code
+resetSvn $OFBIZ_DIR
 svn up
 
-#reset user file modification
-svn revert -R *
+removeUneededFiles $OFBIZ_DIR
 
-#remove user adding file not versionned
-IFS=$'\n'
-for i in $(svn st | grep ^? |cut -c 9-); do rm -fr "$i"; done;
-if [ -n "$(svn st | grep ^?)" ]; then
-    # this to remove all unsupported file name like C:/ created and not cover by previous command
-    for i in $(svn st | grep ^? |cut -c 9-); do
-        rename_file = "$(echo $i| sed s/[:\\\ ]/_/g)";
-        mv "$i" "$rename_file";
-        rm "$rename_file";
-    done;
-fi
-
-#remove unecessary confi for demo
-if [ -n "$(ls $OFBIZ_DIR/framework/base/config/*)" ]; then
-    rm $OFBIZ_DIR/framework/base/config/*.jks
-fi
-if [ -r "$OFBIZ_DIR/framework/base/config/jesse.properties" ]; then
-    rm $OFBIZ_DIR/framework/base/config/jesse.properties
-fi
-
-# Stop, clean and run OFBiz
-./gradlew --no-daemon "ofbiz --shutdown --portoffset 10000"
-./gradlew --no-daemon cleanAll
+# run OFBiz
 ./gradlew --no-daemon "ofbiz --load-data"
 ./gradlew --no-daemon svnInfoFooter
 ./gradlew --no-daemon "ofbizBackground --start --portoffset 10000"

Modified: ofbiz/tools/demo-backup/Nicolas/trunk.sh
URL: http://svn.apache.org/viewvc/ofbiz/tools/demo-backup/Nicolas/trunk.sh?rev=1849676&r1=1849675&r2=1849676&view=diff
==============================================================================
--- ofbiz/tools/demo-backup/Nicolas/trunk.sh (original)
+++ ofbiz/tools/demo-backup/Nicolas/trunk.sh Mon Dec 24 09:03:32 2018
@@ -1,4 +1,6 @@
 #!/bin/bash
+. "functions.sh"
+
 OFBIZ_DIR="/home/ofbizDemo/trunk"
 cd $OFBIZ_DIR
 
@@ -7,31 +9,12 @@ cd $OFBIZ_DIR
 ./gradlew --no-daemon cleanAll
 
 #update source code
+resetSvn $OFBIZ_DIR
 svn up
-./gradlew --no-daemon pullAllPluginsSource
 
-#reset user file modification
-svn revert -R *
+./gradlew --no-daemon pullAllPluginsSource
 
-#remove user adding file not versionned
-IFS=$'\n'
-for i in $(svn st | grep ^? |cut -c 9-); do rm -fr "$i"; done;
-if [ -n "$(svn st | grep ^?)" ]; then
-    # this to remove all unsupported file name like C:/ created and not cover by previous command
-    for i in $(svn st | grep ^? |cut -c 9-); do
-        rename_file = "$(echo $i| sed s/[:\\\ ]/_/g)";
-        mv "$i" "$rename_file";
-        rm "$rename_file";
-    done;
-fi
-
-#remove unecessary confi for demo
-if [ -n "$(ls $OFBIZ_DIR/framework/base/config/*)" ]; then
-    rm $OFBIZ_DIR/framework/base/config/*.jks
-fi
-if [ -r "$OFBIZ_DIR/framework/base/config/jesse.properties" ]; then
-    rm $OFBIZ_DIR/framework/base/config/jesse.properties
-fi
+removeUneededFiles $OFBIZ_DIR
 
 # run OFBiz
 ./gradlew --no-daemon loadAll