The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Automating Development image Builds

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Automating Development image Builds Posted: Apr 26, 2007 6:42 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Automating Development image Builds
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

I did a screencast yesterday on automating the build of a development image; after fielding a few questions, I figured I'd post the relevant scripts. First, I use this workspace script to save my Store Repository profiles out to disk:


fname := 'connects.txt' asFilename writeStream.
Store.RepositoryManager.Repositories do: [:each |
	1 to: each class allInstVarNames size do: [:evar |
		| obj |
		obj := each instVarAt: evar.
		obj isNil 
			ifTrue: [fname nextPutAll: 'nil']
			ifFalse: [fname nextPutAll: obj].
		fname nextPut: $,].
	fname nextPut: Character cr].
	fname close.

That saves my repository information out to a simple, comma/CR delimited flat file. With that, I can automate the build of a development image with a script like the one below (obviously, the mix of parcels and store package/bundles will vary):

| fname list |

"do initial parcel load"
#(
        '$(VISUALWORKS)\database\oraclethapiexdi.pcl'
        '$(VISUALWORKS)\contributed\postgresql\storeforpostgresql.pcl'
        '$(VISUALWORKS)\store\storefororacle.pcl'
        '$(VISUALWORKS)\contributed\sunit\sunitui.pcl'
        '$(VISUALWORKS)\parcels\rbsunitextensions.pcl'
        '$(VISUALWORKS)\net\netclients.pcl'
) do: [:each |
        Parcel loadParcelFrom: each].


"read in Repository settings"
fname := 'connects.txt' asFilename readStream.
list := OrderedCollection new.
[fname atEnd]
	whileFalse: [
		| prof str line i |
		line := fname upTo: Character cr.
		str := line readStream.
		prof := Store.ConnectionProfile new.
		i := 1.
		[str atEnd]
			whileFalse: [
				|  next |
					next := str upTo: $,.
				next = 'nil' ifTrue: [next := nil].
				prof instVarAt: i put: next.
				i := i + 1].
		list add: prof].
	fname close.
	list do: [:each |
		Store.RepositoryManager addRepository: each].

"connect to Store"
profile := Store.RepositoryManager repositories 
	detect: [:each | 'cincomsmalltalk' = each name] 
	ifNone: [nil].
profile ifNil: [^self].
Store.DbRegistry connectTo: profile.

"load a bundle"
(Store.Bundle newestVersionWithName: 'RSSBuilding') loadSrc.

"disconnect"
Store.DbRegistry disconnect.

"save image"
ObjectMemory saveAs: 'team' thenQuit: false

It probably makes sense to split the individual sections out, and to create "manifest" files of parcels/package to load - but you get the idea. This is a nice, simple way to automate a build - and you don't even need to "doIt" after starting your image. Instead, start the base visual.im as follows:

visual visual.im -filein build-team.st

That's it - works nicely for me

Technorati Tags:

Read: Automating Development image Builds

Topic: Smalltalk on the Road Previous Topic   Next Topic Topic: The beginning of Utility Computing?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use