-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f3006f
commit 5e795fa
Showing
4 changed files
with
171 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
#!/usr/bin/env superdoit_solo | ||
options | ||
{ | ||
SuperDoitRequiredOptionWithRequiredArg long: 'registry'. | ||
SuperDoitOptionalOptionWithNoArg long: 'netldi' short: 'b'. | ||
SuperDoitOptionalOptionWithNoArg long: 'restart' short: 'r'. | ||
SuperDoitOptionalOptionWithNoArg long: 'notranlogs' short: 'N'. | ||
SuperDoitOptionalOptionWithNoArg long: 'restore' short: 'R'. | ||
SuperDoitOptionalOptionWithRequiredArg long: 'wait' short: 'w'. | ||
SuperDoitOptionalOptionWithNoArg long: 'verbose' short: 'v'. | ||
} | ||
% | ||
Usage | ||
----- | ||
USAGE $basename [--help | -h] [--debug | -D] [--debugGem] [-v | --verbose] \ | ||
--registry=<registry-name> <stone-name> | ||
|
||
DESCRIPTION | ||
Start named stone. | ||
|
||
OPTIONS | ||
-h, --help display usage message | ||
-D, --debug bring up topaz debugger in the event of a script error | ||
--debugGem If terminal is connected to stdout, bring up debugger. If not, | ||
dump stack to stdout and wait for topaz to attach using topaz | ||
DEBUGGEM command. | ||
-v, --verbose Verbose logging enabled. | ||
--registry Name of registry that stone is defined in (Required). | ||
-b, --netldi Start netldi associated with the stone. | ||
-r, --restart Stop and restart stone if is is already running. | ||
-N, --notranlogs | ||
Start without transaction logs. | ||
-R, --restore Start for restore. | ||
-w <waitstone-timeout>, | ||
--wait=<waitstone-timeout> | ||
If stone not started within <waitstone-timeout> seconds, signal | ||
an error. | ||
|
||
|
||
EXAMPLES | ||
$basename --help | ||
$basename -D | ||
$basename --debugGem | ||
$basename --registry=bosch bosch_370 | ||
$basename --registry=bosch bosch_370 -b | ||
$basename --registry=bosch bosch_370 -r | ||
$basename --registry=bosch bosch_370 -N | ||
$basename --registry=bosch bosch_370 -w 5 | ||
----- | ||
% | ||
specs | ||
[ | ||
RwLoadSpecificationV2 { | ||
#projectName : 'GsDevKit_stones', | ||
#projectSpecFile : 'rowan/project.ston', | ||
#componentNames : [ | ||
'Core', | ||
'Solo' | ||
], | ||
#platformProperties : { | ||
'gemstone' : { | ||
'allusers' : { | ||
#defaultSymbolDictName : 'Globals' | ||
} | ||
} | ||
}, | ||
#comment : '' | ||
}, | ||
RwLoadSpecificationV2 { | ||
#projectName : 'GsCommands', | ||
#projectSpecFile : 'rowan/project.ston', | ||
#diskUrl : '$GEMSTONE/examples/GsCommands/projectsHome/GsCommands', | ||
#componentNames : [ | ||
'Commands' | ||
], | ||
#platformProperties : { | ||
'gemstone' : { | ||
'allusers' : { | ||
#defaultSymbolDictName : 'UserGlobals' | ||
} | ||
} | ||
}, | ||
#comment : '' | ||
} | ||
] | ||
% | ||
doit | ||
| registryClass stonesRegistry stoneName stoneSpec | | ||
self preDoitSpecLoad: [:spec | | ||
spec projectName = 'GsCommands' | ||
ifTrue: [ spec projectsHome: '$GEMSTONE/examples/GsCommands/projectsHome' ] | ||
ifFalse: [ spec projectsHome: self dirname asFileReference parent parent ] ]. | ||
registryClass := (self globalNamed: 'GDKRegistry'). | ||
self verbose | ||
ifTrue: [ (self globalNamed: 'GDKGsDevKit_stonesBase') verbose: true ]. | ||
stonesRegistry := registryClass stonesRegistryNamed: self registry. | ||
self positionalArgs size ~= 1 | ||
ifTrue: [ self error: 'Expected a positional argument: <stone-name>' ]. | ||
stoneName := self positionalArgs at: 1. | ||
stoneSpec := stonesRegistry stoneNamed: stoneName. | ||
System gemEnvironmentVariable: 'GEMSTONE' put: stoneSpec gemstonePath. | ||
stoneSpec startStone: self withSuperDoitOptions: true. | ||
self wait | ||
ifNotNil: [:waitTime | | ||
| status | | ||
status := stoneSpec waitStone: waitTime asNumber. | ||
status != 0 | ||
ifTrue: [ self error: 'The stone did not start within ', waitTime, ' seconds.' ] ]. | ||
^ stonesRegistry | ||
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 2 additions & 39 deletions
41
src/GsDevKit_stones-Core.package/GDKStoneSpec.class/instance/startStone..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,4 @@ | ||
runtime | ||
startStone: superDoitScriptOrNil | ||
| arrayOfOutputs stoneLogFile stdout scriptPath | | ||
stdout := superDoitScriptOrNil | ||
ifNotNil: [ | ||
scriptPath := superDoitScriptOrNil scriptPath. | ||
superDoitScriptOrNil stdout ] | ||
ifNil: [ | ||
scriptPath := ''. | ||
GsFile stdout ]. | ||
stdout | ||
lf; | ||
nextPutAll: | ||
'====== ' , scriptPath , ' starting stone at ' , DateAndTime now printString; | ||
lf; | ||
lf. | ||
self defineCustomEnvVars. | ||
stoneLogFile := (self rootDir / self stoneDirectorySpec logs / self stoneName | ||
, 'log') pathString. | ||
[ | ||
arrayOfOutputs := (Rowan globalNamed: 'GsStartStone') | ||
startStone: self stoneName | ||
exeConfFile: self sysConfFile pathString | ||
logFile: stoneLogFile ] | ||
on: ChildError | ||
do: [ :ex | | ||
| stoneLog | | ||
stoneLog := stoneLogFile asFileReference. | ||
stoneLog exists | ||
ifFalse: [ ^ ex pass ]. | ||
stdout | ||
nextPutAll: stoneLog contents; | ||
lf. | ||
stdout | ||
nextPutAll: '****************************************'; | ||
lf. | ||
^ self error: 'Stone did not start' ]. | ||
stdout nextPutAll: (arrayOfOutputs at: 1). "stdout" | ||
stdout | ||
nextPutAll: '****************************************'; | ||
lf | ||
|
||
self startStone: superDoitScriptOrNil withSuperDoitOptions: false |
56 changes: 56 additions & 0 deletions
56
...evKit_stones-Core.package/GDKStoneSpec.class/instance/startStone.withSuperDoitOptions..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
runtime | ||
startStone: superDoitScriptOrNil withSuperDoitOptions: superDoitOptionsBoolean | ||
"if superDoitOptionsBoolean is true, then superDoitScriptOrNil is expected to respond to the following messages: | ||
restart | ||
conversion | ||
notranlogs | ||
restore" | ||
|
||
| arrayOfOutputs stoneLogFile stdout scriptPath notranlogsMode restorMode | | ||
notranlogsMode := restorMode := false. | ||
stdout := superDoitScriptOrNil | ||
ifNotNil: [ | ||
scriptPath := superDoitScriptOrNil scriptPath. | ||
superDoitOptionsBoolean | ||
ifTrue: [ | ||
notranlogsMode := superDoitScriptOrNil notranlogs. | ||
restorMode := superDoitScriptOrNil restore ]. | ||
superDoitScriptOrNil stdout ] | ||
ifNil: [ | ||
scriptPath := ''. | ||
GsFile stdout ]. | ||
stdout | ||
lf; | ||
nextPutAll: | ||
'====== ' , scriptPath , ' starting stone at ' , DateAndTime now printString; | ||
lf; | ||
lf. | ||
self defineCustomEnvVars. | ||
stoneLogFile := (self rootDir / self stoneDirectorySpec logs / self stoneName | ||
, 'log') pathString. | ||
[ | ||
arrayOfOutputs := (Rowan globalNamed: 'GsStartStone') | ||
startStone: self stoneName | ||
exeConfFile: self sysConfFile pathString | ||
sysConfFile: self sysConfFile pathString | ||
logFile: stoneLogFile | ||
noTranlogs: notranlogsMode | ||
restoreMode: restorMode | ||
conversionMode: false ] | ||
on: ChildError | ||
do: [ :ex | | ||
| stoneLog | | ||
stoneLog := stoneLogFile asFileReference. | ||
stoneLog exists | ||
ifFalse: [ ^ ex pass ]. | ||
stdout | ||
nextPutAll: stoneLog contents; | ||
lf. | ||
stdout | ||
nextPutAll: '****************************************'; | ||
lf. | ||
^ self error: 'Stone did not start' ]. | ||
stdout nextPutAll: (arrayOfOutputs at: 1). "stdout" | ||
stdout | ||
nextPutAll: '****************************************'; | ||
lf |