Hi Esteban,

I tried your snippets, see comments below.

> On 29 Oct 2019, at 11:07, Esteban Lorenzano <esteba...@gmail.com> wrote:
> 
> Hi Sven,
> 
> You are facing two different problems at the same time :)
> 1) a problem with Metacello api. There is a mismatch between git and 
> metacello because the apis are not equivalent (specially having iceberg in 
> the middle). 
> If you want to use HTTPS in metacello you have to explicit you want to use 
> HTTPS, but you still has to use the GitHub:// identifier.
> 
> If you execute first: 
> 
> ./pharo build.image eval --save "Iceberg remoteTypeSelector: #httpsUrl”
> 
> Then your execution: 
> 
> ./pharo build.image metacello install github://svenvc/ztimestamp 
> BaselineOfZTimestamp
> 
> Will work without warnings. 

Yes, this now removes the warning (not that that was a real problem).
I do not think I understand the implications of changing the remoteTypeSelector 
though.

> Now, you have another problem: 
> 2) You cannot use an url as this with iceberg/metacello: 
> https://deploy:secret@.../scm/xyz/xyz-pharo.git
> And yes, we could do a parse of it and use it (also solving your metacello 
> command problem), but this is not easily doable and it would take time. 
> The usual way of doing this is not using HTTPS but distributing 
> public/private keys (then you use the regular SSH protocol).
> But if you still want/need to use HTTPS, then you need to provide your 
> plaintext credentials.
> For iceberg, your credentials are stored in your preferences directory, at 
> credentials.fuel (so you could add them to your CI server, if you have them).
> To add them programatically you need to do something like this: 
> 
> ./pharo build.image eval --save "IceCredentialStore current
>       storeCredential: (IcePlaintextCredentials new
>               username: 'esteban';
>               password: 'secret';
>               yourself)
>       forHostname: ‘github.com’"
> 
> Then you full script will be like this: 
> 
> ./pharo build.image eval --save “
>     Iceberg remoteTypeSelector: #httpsUrl”.
>     IceCredentialStore current
>       storeCredential: (IcePlaintextCredentials new
>               username: 'esteban';
>               password: 'secret';
>               yourself)
>       forHostname: 'github.com'
> “
> ./pharo build.image metacello install github://svenvc/ztimestamp 
> BaselineOfZTimestamp
> 
> I hope this solves your problem :)

This worked as well, but since ZTimestamp is a public GitHub.com project, I am 
not sure the authentication is really used. I tried with my GitHub.com 
credentials (username/password) and it loaded, but when I altered the password 
for a wrong one, it still worked ;-)

Now, the problem is: how do I access the private, password protected repository 
of my company ?

I tried to add a host to the github:// URL but I do not have the impression 
that this works.

Since making this more concrete involves some sensitive information, I will 
send you a private email with the details of a test project/repository/user 
that I made.

Sven

PS: I want to stress that for me Iceberg works really well on my local 
development machine: I created the test project/code/baseline without 
encountering any issue (Pharo 7).

> Esteban
> 
> On Mon, Oct 28, 2019 at 11:58 AM Sven Van Caekenberghe <s...@stfx.eu> wrote:
> I am still at a loss with this issue.
> 
> When loading from github://svenvc/ztimestamp using Metacello (see original 
> mail) the code in 
> MCGitBasedNetworkRepository>>#createIcebergRepositoryWithFallbackFor:url: 
> clearly switches to using https://github.com/svenvc/ztimestamp.git - I traced 
> it.
> 
> So obviously, Pharo 7 is capable of accessing it.
> 
> However, starting directly with https://github.com/svenvc/ztimestamp.git I 
> end up in a totally different place. Why ?
> 
> This code is so complex... 
> 
> > On 25 Oct 2019, at 14:49, Sven Van Caekenberghe <s...@stfx.eu> wrote:
> > 
> > Hi,
> > 
> > I asked this before, but I still have trouble with this.
> > 
> > What I ultimately want is what I used for years now: use the zero config 
> > tools to point to my private repo and install my code and all its 
> > dependencies from a single Metacello config.
> > 
> > Basically,
> > 
> > $vm $image config _CONFIG_REPO_ _CONFIG_NAME_ --username=_CONFIG_USER_ 
> > --password=_CONFIG_PASS_ --install=_CONFIG_VERSION_ --group=_CONFIG_GROUP_
> > 
> > towards a private server.
> > 
> > In the new world of git(hub)/tonel/iceberg I am trying the following (not 
> > using the 'config' but the new 'metacello' command line handler):
> > 
> > $ uname -a
> > Linux audio359 4.15.0-39-generic #42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 
> > 2018 x86_64 x86_64 x86_64 GNU/Linux
> > 
> > $ curl get.pharo.org/64/70+vm | bash
> >  % Total    % Received % Xferd  Average Speed   Time    Time     Time  
> > Current
> >                                 Dload  Upload   Total   Spent    Left  Speed
> > 100  3054  100  3054    0     0  57622      0 --:--:-- --:--:-- --:--:-- 
> > 57622
> > Downloading the latest 70 Image:
> >    http://files.pharo.org/get-files/70/pharo64.zip
> > Pharo.image
> > Downloading the latest pharoVM:
> >       http://files.pharo.org/get-files/70/pharo64-linux-stable.zip
> > pharo-vm/pharo
> > Creating starter scripts pharo and pharo-ui
> > 
> > $ ./pharo Pharo.image printVersion
> > [version] 'Pharo7.0.4' 
> > 'Pharo-7.0.4+build.168.sha.ccd1f6489120f58ddeacb2cac77cd3a0f0dcfbe6 (64 
> > Bit)'
> > 
> > $ ./pharo Pharo.image save build
> > 
> > $ ./pharo build.image metacello install github://svenvc/ztimestamp 
> > BaselineOfZTimestamp
> > 
> > 3. using HTTPS instead SSH (Just use an url in the form HTTPS://etc.git). I 
> > will try to clone the HTTPS variant.
> > Fetched -> BaselineOfZTimestamp-CompatibleUserName.1554735117 --- 
> > https://github.com/svenvc/ztimestamp.git[master] --- 
> > https://github.com/svenvc/ztimestamp.git[master]
> > Loaded -> BaselineOfZTimestamp-CompatibleUserName.1554735117 --- 
> > https://github.com/svenvc/ztimestamp.git[master] --- 
> > https://github.com/svenvc/ztimestamp.git[master]
> > Loading baseline of BaselineOfZTimestamp...
> > Fetched -> ZTimestamp-CompatibleUserName.1554735117 --- 
> > https://github.com/svenvc/ztimestamp.git[master] --- 
> > https://github.com/svenvc/ztimestamp.git[master]
> > Loaded -> ZTimestamp-CompatibleUserName.1554735117 --- 
> > https://github.com/svenvc/ztimestamp.git[master] --- cache
> > ...finished baseline 
> > 
> > $ ./pharo build.image eval ZTimestamp now
> > 2019-10-25T12:28:34Z
> > 
> > So although it gave a warning, it worked fine.
> > 
> > The warning said, 
> > 
> > using HTTPS instead SSH (Just use an url in the form HTTPS://etc.git). I 
> > will try to clone the HTTPS variant.
> > 
> > so let's try that after cleaning everything:
> > 
> > $ rm -rf pharo-local/ build.*
> > 
> > $ ./pharo Pharo.image save build
> > 
> > $ ./pharo build.image metacello install 
> > https://github.com/svenvc/ztimestamp.git BaselineOfZTimestamp
> > 
> > ...RETRY->BaselineOfZTimestamp
> > ...RETRY->BaselineOfZTimestamp
> > ...FAILED->BaselineOfZTimestampCould not resolve: BaselineOfZTimestamp 
> > [BaselineOfZTimestamp] in /home/sven/pharo7/pharo-local/package-cache 
> > https://github.com/svenvc/ztimestamp.git
> > MetacelloFetchingMCSpecLoader(MetacelloCommonMCSpecLoader)>>retryingResolvePackageSpecReferences:gofer:
> > 
> > WTF ? Why does this not work (I can perfectly git clone that URL) ?
> > 
> > Of course, this would just be the first step, eventually I want to use my 
> > own private server with a URL like 
> > 
> > https://deploy:sec...@bitbucket.myserver.be/scm/xyz/xyz-pharo.git
> > 
> > How do you build/deploy non-public production code using the command line ?
> > 
> > Help would be much appreciated.
> > 
> > Sven
> > 
> 
> 


Reply via email to