# def-recycle-server.psm1 cloned from run-gael.def-run-regress-tests.psm1

set-strictmode -version 2.0

function defineFlowTask([Flow]$flow,[Task]$task) {
#--- define
  $def = new-module -asCustomObject -scriptBlock {

    function getTaskDesc([Task]$task) {
      $tfs = $task.tfs;
      $gfn = $tfs.globMap.gaelGlobs.gfn;
      $desc = "Recycle Server - proj=$($gfn.gaelProj) curPort=$($gfn.curPort)";
      return $desc
    }

    function fetchJavaMain([Object]$task,[hashtable]$parms) {
      return 'org.gaelic.psec.RecycleServer'
    }

    function fetchJavaClassStr([Object]$task,[hashtable]$parms) {
      #return '$env:PSEC_V4_UTILS/srp-util/lib;$env:PSEC_V4_UTILS/srp-util/java-gen-prod/production/srp-util;$env:PSEC_V4_UTILS/gael-core/lib;$env:PSEC_V4_UTILS/gael-core/libaux;$env:PSEC_V4_UTILS/gael-core/libaux;$env:PSEC_V4_UTILS/gael-core/libaux;$env:PSEC_V4_UTILS/gael-core/libaux;'
      return '$env:PSEC_V4_UTILS/srp-util/lib;$env:PSEC_V4_UTILS/srp-util/java-gen-prod/production/srp-util;$env:PSEC_V4_UTILS/gael-core/out-lib;$env:PSEC_V4_UTILS/gael-core/lib;$env:PSEC_V4_UTILS/gael-core/libaux;'
    }

    # ---------- define task parameters
    function params([Object]$task,[hashtable]$htOpts) {
      $tfs = $task.tfs;
      $gfn = $tfs.globMap.gaelGlobs.gfn;

      $parms = @{};
      $parms.brief    = "$($task.statlocn)"

      $parms.url       = "http://localhost:$($gfn.curPort)"
      $parms.signal    = ("$($gfn.curBase)" -replace "/war","") + "/restart.txt"
      return  $parms
    }

    # ---------- define task options
    function options([Task]$task) {
      $opts = @();
      $opts += @{type='check';  parm='save';     label='Save';    place='copy local_db.bin to local_db-save.bin'}
      $opts += @{type='check';  parm='stop';     label='Stop';    place='Stop the server, no restart'}
      $opts += @{type='check';  parm='cold';     label='Cold';    place='Make server do cold start (new deploy)'}
      return  ,$opts
    }
    Export-ModuleMember -Variable * -Function *
  }

  return $def;
}







X
PSEC - Powershell Enhanced Capability
1.2.1
  src: recycle-server-recycle-server-recycle-server-lib.psm1

Copyright © 2018-2021, 2022, Rexcel System Inc.