JBAS-415 eg-updater staff client build additions
authorBill Erickson <berickxx@gmail.com>
Tue, 10 Mar 2015 15:36:49 +0000 (11:36 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Track specific versions on the server, but stamp clients with the series
ID instead of the build ID, so older clients can use new server files by
default.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/misc-scripts/eg-updater.sh

index 11c189c..29cca58 100755 (executable)
@@ -74,16 +74,19 @@ function usage {
                 git branch.  Beware this action is destructive.  It discards 
                 all local modifications to files in the checked out branch.
 
-            -s <staff-build-id>
-                Staff client build ID.  If -t is used and no -s is specified,
-                the value for -t will also be used as the build ID.
-
-            -i <code-series>
-                The major code series (e.g. "kcls-2.4") which we are 
-                installing.  If set, a symlink to the staff client build 
-                for the series is also created.  This is useful when clients
-                are deployed with a series version instead of a tag version
-                (which would require a new client with every update).
+            -s <client-server-stamp-id>
+                Server-side staff client files will be stored in this
+                directory on the server.  Typically, this should match the
+                version of the code to be installed.  If -t is used and no 
+                -s is specified, the value for -t will be used as the server
+                stamp ID.  E.g. kcls-2.4.001
+
+            -i <client-series-id>
+                This is the ID set on staff client builds and defines which
+                directory the staff client will request files from.  This 
+                will be a symlink to the directory set by -s.  This allows
+                clients of different versions to access the same set of
+                server files.  E.g. kcls-2.4
 
             -r <git-remote>
                 Defaults to "kcls".
@@ -293,11 +296,20 @@ function build_staff_client {
     fi
     cd $EVERGREEN_BASE/Open-ILS/xul/staff_client 
 
+    STAMP_ID=$CLIENT_BUILD_ID
+    if [ -n "$CLIENT_SERIES_ID" ]; then
+        # use the series as the server stamp ID if available
+        STAMP_ID=$CLIENT_SERIES_ID
+    fi
+
     # xulrunner exe has to be in the source directory to get packaged.
     # link it into place, then later remove it.
     $BUILDER ln -s $XUL_DIR/builds/"xulrunner-$XULRUNNER_VERSION.en-US.win32.zip" .
     $BUILDER make rigrelease
-    $BUILDER make STAFF_CLIENT_STAMP_ID=$CLIENT_BUILD_ID build
+    $BUILDER make STAFF_CLIENT_STAMP_ID=$STAMP_ID \
+        STAFF_CLIENT_BUILD_ID="$CLIENT_BUILD_ID" \
+        STAFF_CLIENT_VERSION="$CLIENT_BUILD_ID" build
+
     $BUILDER make win-client
 
     $OSRF mv evergreen_staff_client_setup.exe \
@@ -360,7 +372,12 @@ function deploy_code {
         fi
     fi
 
-    sudo make STAFF_CLIENT_STAMP_ID="$CLIENT_BUILD_ID" install > /dev/null
+    # Put client server files under the build-id specific directory
+    # so we can track each build individually.  A symlink from the
+    # series (if set) to the latest build is set later.
+    sudo make STAFF_CLIENT_STAMP_ID="$CLIENT_BUILD_ID" \
+        STAFF_CLIENT_BUILD_ID="$CLIENT_BUILD_ID" \
+        STAFF_CLIENT_VERSION="$CLIENT_BUILD_ID" install > /dev/null
     
     # recover ownership of repo files after sudo/install
     sudo chown -R $OWNER:$OWNER $EVERGREEN_BASE