Skip to content

Commit

Permalink
Issue #4: createStone.solo has been fleshed out. stone structure crea…
Browse files Browse the repository at this point in the history
…ted. need to create the the stone-specific metadata for tode and create the session description
  • Loading branch information
dalehenrich committed Jun 3, 2023
1 parent 3db2a55 commit 895a50a
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 18 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,28 @@ createRegistry.solo $registryName
createProjectSet.solo --registry=$registryName --projectSet=$projectSetName --ssh
createProjectSet.solo --registry=$registryName --projectSet=${projectSetName}_https --https
cloneProjectsFromProjectSet.solo --registry=$registryName --projectSet=$projectSetName \
--projectDirectory=$projectsDirectory
registerProductDirectory.solo --registry=$registryName --productDirectory=$gemstoneProductsDirectory
--projectDirectory=$projectsDirectory
registerProductDirectory.solo --registry=$registryName \
--productDirectory=$gemstoneProductsDirectory

# GemStone version not previously downloaded
downloadGemStone.solo --registry=$registryName 3.6.6
# Register full set of previously downloaded product trees
registerProduct.solo --registry=$registryName --fromDirectory=$GS_HOME/shared/downloads/products
registerProduct.solo --registry=$registryName \
--fromDirectory=$GS_HOME/shared/downloads/products
# register named GemStone version using path to product tree
registerProduct.solo --registry=$registryName --productPath=/bosch1/users/dhenrich/_work/d_37x/noop50/gs/product 3.7.0
registerProduct.solo --registry=$registryName \
--productPath=/bosch1/users/dhenrich/_work/d_37x/noop50/gs/product 3.7.0

# register default stones directory
registerStonesDirectory.solo --registry=$registryName --stonesDirectory=/bosch1/users/dhenrich/_issue_4/stones
registerStonesDirectory.solo --registry=$registryName \
--stonesDirectory=/bosch1/users/dhenrich/_issue_4/stones

# register shared tODE directory
registerTodeSharedDir.solo --registry=issue_4 --todeSharedDirectory=/bosch1/users/dhenrich/_issue_4/tode_shared
registerTodeSharedDir.solo --registry=issue_4
--todeSharedDirectory=/bosch1/users/dhenrich/_issue_4/tode_shared \
--populate

registryReport.solo
```

Expand Down
23 changes: 19 additions & 4 deletions bin/registerTodeSharedDir.solo
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,45 @@ options
{
SuperDoitRequiredOptionWithRequiredArg long: 'registry'.
SuperDoitRequiredOptionWithRequiredArg long: 'todeSharedDirectory'.
SuperDoitOptionalOptionWithNoArg long: 'populate'.
}
%
Usage
-----
USAGE $basename [--help | -h] [--debug | -D] [--debugGem] \
--registry=<registry-name> --todeSharedDirectory=<path-to-shared-tode-directory>
--registry=<registry-name> \
--todeSharedDirectory=<path-to-shared-tode-directory>
[--populate]

DESCRIPTION
Register a tode shared directory for the named registry. If the directory does not
exist the directory is created. tODE images store information that is shared by all
tODE images in the named registry. Necessary for a fully functional tODE stone.

The tode shared directory is equivalent to the $GS_HOME/sys/local directory in GsDevKit_home.

This script creates 'server', 'server/stones', 'server/projects' and 'sessions'
subdirectories of the tode shared directory.

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.
--registry Name of registry that stone is defined in (Required).
--todeSharedDirectory=<path-to-shared-tode-directory>
Path to directory where tODE meta data is to be stored (Required).
--populate If specified, the minimum directory structure required by tODE
will be created.

EXAMPLES
$basename --help
$basename -D
$basename --registry=bosch --todeSharedDirectory=/home/dhenrich/gemstone/tode_shared
$basename --registry=bosch \
--todeSharedDirectory=/home/dhenrich/gemstone/tode_shared
$basename --registry=bosch --populate \
--todeSharedDirectory=/home/dhenrich/gemstone/tode_shared
-----
%
specs
Expand Down Expand Up @@ -55,9 +71,8 @@ doit
registryClass := (self globalNamed: 'GDKRegistry').
stonesRegistry := registryClass stonesRegistryNamed: self registry.
todeSharedDir := self todeSharedDirectory asFileReference.
todeSharedDir ensureCreateDirectory.
todeSharedDirPath := GsFile serverRealPath: todeSharedDir pathString.
stonesRegistry todeSharedDirectory: todeSharedDirPath.
stonesRegistry todeSharedDirectory: todeSharedDirPath populate: self populate.
stonesRegistry export.

%
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ createStoneStructureUsing: stonesRegistry
stoneDirSpec createStoneStructure: self. "populate directory structure"
self stoneDirectorySpec: stoneDirSpec ]
on: Error
do: [ :ex | self rootDir deleteAllChildren ]
do: [ :ex |
self rootDir deleteAll.
ex pass ]
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
accessing
todeSharedDirectory: object
todeSharedDirectory := object
todeSharedDirectory: todeSharedDirPath
"The tode shared directory is equivalent to the $GS_HOME/sys/local directory in GsDevKit_home"

(todeSharedDirPath isKindOf: CharacterCollection)
ifFalse: [ self error: 'The todeSharedDirectory is expected to be a CharacterCollection' ].
todeSharedDirectory := todeSharedDirPath
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
accessing
todeSharedDirectory: todeSharedDirPath populate: populate
"The tode shared directory is equivalent to the $GS_HOME/sys/local directory in GsDevKit_home"

| todeSharedDir |
todeSharedDir := todeSharedDirPath asFileReference.
self todeSharedDirectory: todeSharedDirPath.
todeSharedDir ensureCreateDirectory.
(todeSharedDir / 'server') ensureCreateDirectory.
(todeSharedDir / 'server' / 'projects') ensureCreateDirectory.
(todeSharedDir / 'server' / 'stones') ensureCreateDirectory.
(todeSharedDir / 'sessions') ensureCreateDirectory
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
stone creation
createSessionDescripton: stoneSpec
| sessionDescriptionFile |
sessionDescriptionFile := stoneSpec todeSharedDirectory asFileReference / 'sessions'
/ stoneSpec stoneName.
sessionDescriptionFile ensureCreateFile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ createTodeSharedDirectory: stoneSpec
'WARNING: tode shared directory is not defined, use registerTodeSharedDirectory.solo to define' ]
ifNotNil: [ :todeSharedDirectory |
| todeDir |
todeDir := todeSharedDirectory asFileReference / stoneSpec stoneName.
todeDir := todeSharedDirectory asFileReference / 'server' / 'stones'
/ stoneSpec stoneName.
todeDir ensureCreateDirectory.
self class symbolicLink: todeDir linkName: stoneSpec rootDir / 'tode' ]
self class symbolicLink: todeDir linkName: stoneSpec rootDir / 'tode'.
self createTodeStoneMetadata: stoneSpec.
self createSessionDescripton: stoneSpec ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
stone creation
createTodeStoneMetadata: stoneSpec
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
stone destruction
destroyStoneStructure: stoneSpec
| todeDir |
todeDir := stoneSpec todeSharedDirectory asFileReference / stoneSpec stoneName.
todeDir ensureDeleteAll
"clean up the stone-specific tode meta data"

| sharedtodeDir stoneDir sessionsFile |
self halt.
sharedtodeDir := stoneSpec todeSharedDirectory asFileReference.
stoneDir := sharedtodeDir / 'stones' / stoneSpec stoneName.
stoneDir ensureDeleteAll.
sessionsFile := sharedtodeDir / 'sessions' / stoneSpec stoneName.
sessionsFile ensureDelete

0 comments on commit 895a50a

Please sign in to comment.