Skip to content

Commit

Permalink
Issue #4: checkpoint ...add default password entries; fine tune creat…
Browse files Browse the repository at this point in the history
…e stone; implement destroy stone
  • Loading branch information
dalehenrich committed May 31, 2023
1 parent 8f50829 commit d21a99f
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 8 deletions.
83 changes: 83 additions & 0 deletions bin/deleteStone.solo
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env superdoit_solo
options
{
SuperDoitRequiredOptionWithRequiredArg long: 'registry'.
SuperDoitOptionalOptionWithNoArg long: 'verbose' short: 'v'.
}
%
Usage
-----
USAGE $basename [--help | -h] [--debug | -D] [--debugGem] [-v | --verbose] \
--registry=<registry-name> <stone-name>

DESCRIPTION
Shut down stone and netldi. Delete the directory structure and meta data associated
with the 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.

EXAMPLES
$basename --help
$basename -D
$basename --debugGem
$basename --registry=bosch bosch_370
-----
%
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 toneName 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.
stonesRegistry destroyStoneNamed: stoneName.
^ stonesRegistry
%
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
stone creation
createStoneStructure: stoneSpec
| stoneRoot useCustomEnv exportDir gemstoneReference systemConfStream useTranlogDir useExtentDir |
| stoneRoot useCustomEnv exportDir gemstoneReference systemConfStream useTranlogDir useExtentDir userId password |
exportDir := Dictionary new.
stoneRoot := stoneSpec rootDir.
useTranlogDir := ''.
useExtentDir := '/'.
useCustomEnv := false.
userId := 'DataCurator'.
password := 'swordfish'.
gemstoneReference := stoneSpec gemstonePath asFileReference.
System gemEnvironmentVariable: 'GEMSTONE' put: gemstoneReference pathString.
self class symbolicLink: gemstoneReference linkName: stoneRoot / 'product'.
Expand Down Expand Up @@ -52,6 +54,10 @@ createStoneStructure: stoneSpec
ifTrue: [ (stoneRoot / value) ensureCreateDirectory ].
key = #'projectsHome'
ifTrue: [ (stoneRoot / value) ensureCreateDirectory ].
key = #'userId'
ifTrue: [ userId := value ].
key = #'password'
ifTrue: [ password := value ].
key = #'product'
ifTrue: [
"noop, as product symbolic link is created by default"
Expand Down Expand Up @@ -95,6 +101,6 @@ createStoneStructure: stoneSpec
fileStream
nextPutAll: 'set GEMSTONE ' , stoneSpec stoneName;
lf;
nextPutAll: 'set u DataCurator p swordfish';
nextPutAll: 'set u ', userId, ' p ', password;
lf ].
self class chmod: (stoneRoot / '.topazini') pathString fileMode: 'u+w,og-rw'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
password: object
password := object
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
password
^password ifNil: [ ^ 'swordfish' ]
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"netLdiPort",
"gemTask",
"userId",
"password",
"osUserId",
"stoneDirectorySpecName",
"stoneDirectorySpec",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
stone management
destroyStoneNamed: stoneName

| stoneSpec |
stoneSpec := self stoneNamed: stoneName.
stoneSpec destroyStoneStructure
4 changes: 3 additions & 1 deletion templates/default.ston
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ GDKhomeStoneDirectorySpec{
#name : 'default',
#backups : 'backups',
#bin : 'bin',
#customenv: 'customenv',
#extents : 'extents',
#logs : 'logs',
#stats : 'stats',
#tranlogs : 'tranlogs',
#snapshots : 'snapshots',
#product : 'product'
#tode : 'tode'
#tode : 'tode',
#userId : 'DataCurator'
}
4 changes: 3 additions & 1 deletion templates/default_rowan.ston
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ GDKstonesStoneDirectorySpec {
#name : 'default_rowan',
#backups : 'backups',
#bin : 'bin',
#customenv: 'customenv',
#dbfSource : '$GEMSTONE/bin/extent0.rowan.dbf',
#extents : 'extents',
#logs : 'logs',
#stats : 'stats',
#tranlogs : 'tranlogs',
#snapshots : 'snapshots',
#product : 'product'
#product : 'product',
#userId : 'SystemUser'
}
4 changes: 3 additions & 1 deletion templates/default_seaside.ston
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ GDKhomeStoneDirectorySpec {
#name : 'default_seaside',
#backups : 'backups',
#bin : 'bin',
#customenv: 'customenv',
#dbfSource : '$GEMSTONE/bin/extent0.seaside.dbf',
#extents : 'extents',
#logs : 'logs',
#stats : 'stats',
#tranlogs : 'tranlogs',
#snapshots : 'snapshots',
#product : 'product',
#tode : 'tode'
#tode : 'tode',
#userId : 'DataCurator'
}
3 changes: 2 additions & 1 deletion templates/minimal.ston
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ GDKstonesStoneDirectorySpec {
#name : 'minimal',
#customenv: 'customenv',
#bin : 'bin',
#logs : 'logs'
#logs : 'logs',
#userId : 'SystemUser'
}
3 changes: 2 additions & 1 deletion templates/minimal_rowan.ston
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ GDKstonesStoneDirectorySpec {
#customenv: 'customenv',
#dbfSource : '$GEMSTONE/bin/extent0.rowan.dbf',
#bin : 'bin',
#logs : 'logs'
#logs : 'logs',
#userId : 'SystemUser'
}
3 changes: 2 additions & 1 deletion templates/minimal_seaside.ston
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ GDKstonesStoneDirectorySpec {
#customenv: 'customenv',
#dbfSource : '$GEMSTONE/bin/extent0.seaside.dbf',
#bin : 'bin',
#logs : 'logs'
#logs : 'logs',
#userId : 'DataCurator'
}

0 comments on commit d21a99f

Please sign in to comment.