Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy several Monticello commits from local repository to Smalltalkhub.com automatically?

I commit several versions of Monticello packages to a local repository on my disk during the day.

At a later time I want to sync the local repository with a Smalltalkhub.com repository.

At the moment I copy the local commits manually one by one to the Smalltalkhub repository using the Monticello browser.

How can i automate this task?

like image 917
MartinW Avatar asked Mar 24 '23 07:03

MartinW


2 Answers

In the Gofer chapter of the "deep into pharo" new free book (pharo by example two - http://rmod.lille.inria.fr/pbe2/.) I presented Gofer in details. In particular I present some ways to migrate between repositories
The default for Gofer is fetch and pull, based on that you can easily build sync.

For example if you use Smalltalk hub

Gofer new
  smalltalkhubUser: 'PharoBooks' project: 'GoferExample'; 
  package: 'PBE2GoferExample';
  package: 'PBE2GoferExampleSecondPackage';
  push.
Gofer new
  smalltalkhubUser: 'PharoBooks' project: 'GoferExample'; 
  package: 'PBE2GoferExample';
  package: 'PBE2GoferExampleSecondPackage';
  fetch

You can also obtain some information as follows

((Gofer new
  smalltalkhubUser: 'Pharo' project: 'NativeBoost'; allResolved)
     groupedBy: [ :each | each packageName])

Now you can also migrate

 | go |
 go := Gofer new squeaksource3: 'Pharo20'. 
 go allResolved
    do: [ :each | self crLog: each packageName. 
        go package: each packageName;
        fetch]

Then once you get the files in your local directory you can push to another repository.

  | go |
  go := Gofer new.
  go repository: (MCHttpRepository
                   location: 'http://ss3.gemtalksystems.com/ss/rb-pharo' 
                   user: 'pharoUser' 
                   password: 'pharoPwd').
  (((FileSystem disk workingDirectory / 'package-cache') allFiles 
       select: [:each | '*.mcz' match: each basename])
                    groupedBy: [:each | (each base copyUpToLast: $-) ]) keys 
                                            do: [:name | go package: name; push]
like image 164
Stephane Ducasse Avatar answered Apr 25 '23 09:04

Stephane Ducasse


You can use Gofer to automate your Monticello tasks.

 Gofer new
   package: 'MyProject-Core';
   package: 'MyProject-Tests';
   url: 'http://smalltalkhub.com/mc/USER/MyProject/main/' username: 'USER' password: '***';
   push.
like image 37
camillobruni Avatar answered Apr 25 '23 07:04

camillobruni