Skip to content

Commit

Permalink
Isue #4: working through setUpSys and progressed through 'mount --tod…
Browse files Browse the repository at this point in the history
…eRoot' commands
  • Loading branch information
dalehenrich committed Jul 31, 2023
1 parent fb695a5 commit 132cfff
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ todeHomeDirectory: todeHomePath populate: populate
ifTrue: [
todeHomeDir ensureCreateDirectory.
(todeHomeDir / 'sys') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'default') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server') ensureCreateDirectory.
(todeHomeDir / 'sys' / 'local' / 'server' / 'gemstone') ensureCreateDirectory.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
server external session calls
_serverExecuteString: executeString debugMode: debugMode
_serverExecuteString: executeString debugMode: debugModeBool
| doitString |
debugMode := debugModeBool.
doitString := debugMode
ifTrue: [
'
Expand All @@ -14,7 +15,7 @@ _serverExecuteString: executeString debugMode: debugMode
[ self session nbExecute: doitString ]
on: GsErrorNotification
do: [ :ex | self error: 'Unable to execute #executeString: on tODE server' ].
[self session nbResult]
[ self session nbResult ]
on: GciError
do: [ :ex |
ex gsNumber = 2336
Expand All @@ -26,5 +27,4 @@ _serverExecuteString: executeString debugMode: debugMode
session: self;
tag: ex gciErrSType;
signal ].
ex continue. "after this continue, lastResult is the string we are looking for, however, the continue is necessary and we end up returning something different"
] ]
ex continue "after this continue, lastResult is the string we are looking for, however, the continue is necessary and we end up returning something different" ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
private
_setupSessionForGsDevKit_stones
"set up the tODE for GsDevKit_stones environment. session has been logged in, so we can
execute commands and set up environement:
1. set gitRootPath
"

| executeString doitString |
executeString := 'TDProjectEntryDefinition defaultGitRootPath: '
, self sessionDescription serverGitRoot printString.
doitString := debugMode
ifTrue: [
'
[
^ (' , executeString
,
') ]
on: Error, Halt
do: [ :ex | System waitForDebug ]' ]
ifFalse: [ executeString ].


[ self session nbExecute: doitString ]
on: GsErrorNotification
do: [ :ex | self error: 'Unable send #backupDirectory: message to tODE server' ].
^ self session nbResult
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
debugMode
"if true, remote debugging via debugGem will be enabled"

^ debugMode
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
evaluation
evaluateCommand: command batchMode: batchBool debugMode: debugMode
other
evaluateCommand: command batchMode: batchBool debugMode: debugModeBool
| stonString |
stonString := STON toString: command.
^ self
_serverExecuteString:
'(' , self todeServerAccessString , ' for: ' , self shell shellId asString
, ') evaluateSTONCommand:' , stonString printString
debugMode: debugMode
debugMode: debugModeBool
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ session
session
ifNil: [
session := self login.
self topezServerProxy ].
self topezServerProxy.
self _setupSessionForGsDevKit_stones].
^ session
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"shell",
"session",
"topezServerProxy",
"debugMode",
"clientForwarderCache",
"serverApiVersion",
"effectiveApiVersion" ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,43 @@ evaluate: aString batchMode: aBool
TDCommandLine
fromStream: aString readStream
selectLine: [ :line | true ]
forEachCommand: [ :command | result := self evaluateCommand: command batchMode: aBool ].
forEachCommand: [ :command |
| index commandLine todeRoot rest |
commandLine := command commandLine copy.
todeRoot := '--todeRoot'.
(command command = 'mount'
and: [ (index := commandLine findString: todeRoot startingAt: 1) > 0 ])
ifTrue: [
| newCommandLine commandStream skipDone |
"--todeRoot option for mount command uses a call back, so hard-wire todeRoot path into the command
and remove --todeRoot option from commandLine"
newCommandLine := (commandLine copyFrom: 1 to: index - 1)
, (commandLine copyFrom: index + todeRoot size to: commandLine size).
commandStream := newCommandLine readStream.
commandStream
skipSeparators;
skip: 'mount' size;
skipSeparators;
yourself.
newCommandLine := 'mount ' , self sessionDescription serverTodeRoot.
commandStream peek = $/
ifFalse: [
(self sessionDescription serverTodeRoot endsWith: '/')
ifFalse: [ newCommandLine add: '/' ] ].
skipDone := false.
[ skipDone ]
whileFalse: [
| char |
"characters up to the next separator are part of first positional argument <directory-or-file-path>"
(char := commandStream next) isSeparator
ifTrue: [ skipDone := true ].
newCommandLine add: char ].
rest := commandStream upToEnd.
newCommandLine add: rest.
TDCommandLine
fromStream: newCommandLine readStream
forEachCommand: [ :newCommand | result := self evaluateCommand: newCommand batchMode: aBool ] ]
ifFalse: [ result := self evaluateCommand: command batchMode: aBool ] ].
^ result ]
on: Error , TDRestoreFromBackupComplete , GsTopezCommandErrorNotification
do: [ :ex |
Expand Down
7 changes: 7 additions & 0 deletions tode/example7
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# test project command
#
# ... look in the gemnet file for the gem to find the
# DEBUGGEM expression to use
#
project new --force Foo
13 changes: 13 additions & 0 deletions tode/setUpSys
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Set up /sys node structure
mount --todeRoot / / _home
mount --todeRoot sys/default /sys default
mount --todeRoot sys/local /sys local
mount --todeRoot sys/local/server/stones /sys stones
# ensure that --stoneRoot directory structure is present
# /sys/default/bin/validateStoneSysNodes --files --repair
mount --stoneRoot / /sys stone
# Define /home and /projects based on a composition of the /sys nodes
mount --stoneRoot homeComposition.ston / home
mount --stoneRoot projectComposition.ston / projects
commit
cd

0 comments on commit 132cfff

Please sign in to comment.