Skip to content

Commit

Permalink
Issue #261: first draft of doCreateStone [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dalehenrich committed Oct 25, 2019
1 parent 4ee296e commit 011cfc3
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
gsdevkit utilities
createStone: stoneName version: gemstoneVersion args: args
| commandPath |
commandPath := '$GS_HOME/bin/createStone' asFileReference pathString. "Use asFileReference to resolve $GS_HOME in commandPath"
self
execute: commandPath , ' ' , args , ' ' stoneName , ' ' , gemstoneVersion
exitStatusBlock: [ :exitStatus :stdout :stderr |
exitStatus ~= 0
ifTrue: [ Error signal: 'Error , ' , stderr asString ].
self stdout nextPutAll: stdout.
^ stdout ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
shell utilities
ln: args
| cmd |
cmd := '/bin/ln ' , args.
self
execute: cmd
exitStatusBlock: [ :exitStatus :stdout :stderr |
exitStatus ~= 0
ifTrue: [ Error signal: 'Error , ' , stderr asString ].
^ stdout ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
gsdevkit utilities
startNetldi: stoneName
^ self startNetldi: stoneName args: ''
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
gsdevkit utilities
startNetldi: stoneName args: startNetldiCommandLineArgs
| commandPath |
commandPath := '$GS_HOME/bin/startNetldi' asFileReference pathString. "Use asFileReference to resolve $GS_HOME in commandPath"
self
execute: commandPath , ' ' stoneName , ' ' , startNetldiCommandLineArgs
exitStatusBlock: [ :exitStatus :stdout :stderr |
exitStatus ~= 0
ifTrue: [ Error signal: 'Error , ' , stderr asString ].
self stdout nextPutAll: stdout.
^ stdout ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
gsdevkit utilities
stopNetldi: stoneName
| commandPath |
commandPath := '$GS_HOME/bin/stopNetldi' asFileReference pathString. "Use asFileReference to resolve $GS_HOME in commandPath"
self
execute: commandPath , ' ' stoneName
exitStatusBlock: [ :exitStatus :stdout :stderr |
exitStatus ~= 0
ifTrue: [ Error signal: 'Error , ' , stderr asString ].
self stdout nextPutAll: stdout.
^ stdout ]
Original file line number Diff line number Diff line change
@@ -1,4 +1,59 @@
actions
doCreateStone
"
1. create GsDevKit_home stone
2. update custom_stone.env and restart netldi
3. populate the stone directory with usful development scripts
4. run the newBuild_SystemUser_gsdevkit_launcher_tode script to build initial development stone
"

| createSummary stoneDir customEnv contents gsdevkitStoneScriptDir |
self createStone
ifFalse: [ ^ self summary ]
ifFalse: [ ^ self summary ].
createSummary := Dictionary new.
self summary at: #'create' put: createSummary.
stoneDir := ('$GS_HOME/server/stones/' , self stoneName) asFileReference.
stoneDir exists
ifTrue: [
createSummary
at: self stoneName
put: #'skipped' -> ('stone already exists at ' , stoneDir pathString) ]
ifFalse: [
self class createStone: self stoneName version: '3.5.0' args: '-g'.
self createSummary
at: self stoneName
put: #'created' -> stoneDir pathString.
customEnv := stoneDir / 'custome_stone.env'.
contents := customEnv contents.
customEnv
writeStreamDo: [ :stream |
stream
nextPutAll: contents;
lf;
nextPutAll: 'export ROWAN_PROJECTS_HOME=$GS_HOME/shared/repos';
lf ].
self class stopNetldi: self stoneName.
self class startNetldi: self stoneName. "pick up ROWAN_PROJECTS_HOME in netldi process"
gsdevkitStoneScriptDir := '$GS_HOME/shared/repos/GsDefKit_launcher/bootstrapping/gemstone/gsdefkit_home'
asFileReference.
self
ln:
' -s '
,
(gsdevkitStoneScriptDir / 'newBuild_SystemUser_gsdevkit_launcher_tode')
pathString
, ' ' , stoneDir pathString.
self
ln:
' -s '
,
(gsdevkitStoneScriptDir / 'newBuild_SystemUser_gsdevkit_launcher_deployer')
pathString
, ' ' , stoneDir pathString.
self stdout
nextPutAll:
(System
performOnServer:
'cd ' , stoneDir pathString , '; ./newBuild_SystemUser_gsdevkit_launcher_tode');
lf ].
^ self summary
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,63 @@ GdkL_Install_Launcher >> doClone [

{ #category : 'actions' }
GdkL_Install_Launcher >> doCreateStone [
"
1. create GsDevKit_home stone
2. update custom_stone.env and restart netldi
3. populate the stone directory with usful development scripts
4. run the newBuild_SystemUser_gsdevkit_launcher_tode script to build initial development stone
"

| createSummary stoneDir customEnv contents gsdevkitStoneScriptDir |
self createStone
ifFalse: [ ^ self summary ]
ifFalse: [ ^ self summary ].
createSummary := Dictionary new.
self summary at: #'create' put: createSummary.
stoneDir := ('$GS_HOME/server/stones/' , self stoneName) asFileReference.
stoneDir exists
ifTrue: [
createSummary
at: self stoneName
put: #'skipped' -> ('stone already exists at ' , stoneDir pathString) ]
ifFalse: [
self class createStone: self stoneName version: '3.5.0' args: '-g'.
self createSummary
at: self stoneName
put: #'created' -> stoneDir pathString.
customEnv := stoneDir / 'custome_stone.env'.
contents := customEnv contents.
customEnv
writeStreamDo: [ :stream |
stream
nextPutAll: contents;
lf;
nextPutAll: 'export ROWAN_PROJECTS_HOME=$GS_HOME/shared/repos';
lf ].
self class stopNetldi: self stoneName.
self class startNetldi: self stoneName. "pick up ROWAN_PROJECTS_HOME in netldi process"
gsdevkitStoneScriptDir := '$GS_HOME/shared/repos/GsDefKit_launcher/bootstrapping/gemstone/gsdefkit_home'
asFileReference.
self
ln:
' -s '
,
(gsdevkitStoneScriptDir / 'newBuild_SystemUser_gsdevkit_launcher_tode')
pathString
, ' ' , stoneDir pathString.
self
ln:
' -s '
,
(gsdevkitStoneScriptDir / 'newBuild_SystemUser_gsdevkit_launcher_deployer')
pathString
, ' ' , stoneDir pathString.
self stdout
nextPutAll:
(System
performOnServer:
'cd ' , stoneDir pathString , '; ./newBuild_SystemUser_gsdevkit_launcher_tode');
lf ].
^ self summary
]

{ #category : 'main' }
Expand Down

0 comments on commit 011cfc3

Please sign in to comment.