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

故事扮演 提交于 2019-12-04 10:29:30

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.

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]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!