Launcher User Templates

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Launcher User Templates

Sean P. DeNigris
Administrator
How would I make my own images available via Launcher. Where can I read about
this or can you point me to a hook? Thanks!



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

demarey
Hi Sean,

Le 27 mars 2018 à 16:04, Sean P. DeNigris <[hidden email]> a écrit :

How would I make my own images available via Launcher. Where can I read about
this or can you point me to a hook? Thanks!

If you mean "How would I make my own templates available via Launcher? » then, you can check: https://github.com/pharo-project/pharo-launcher/blob/master/README.md#how-would-i-make-my-own-templates-available-via-pharo-launcher (just added)
If you just want to import images, just click the + icon at the top-right command-bar in the launcher.

Christophe
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

Ben Coman
In reply to this post by Sean P. DeNigris


On 27 March 2018 at 22:04, Sean P. DeNigris <[hidden email]> wrote:
How would I make my own images available via Launcher. Where can I read about
this or can you point me to a hook? Thanks!

Offhand idea...
Now that we are managing Pharo-Image from git, perhaps it would make sense
to move PharoLauncher first-level entry configuration to git?
Also perhaps Pharo Catalog can be managed in same way (if its not already).

cheers -ben
(hic!)

Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

Sean P. DeNigris
Administrator
In reply to this post by demarey
demarey wrote
> If you mean "How would I make my own templates available via Launcher?

Yes, that's it. Sorry about the wrong terminology!



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

demarey

> Le 28 mars 2018 à 21:55, Sean P. DeNigris <[hidden email]> a écrit :
>
> demarey wrote
>> If you mean "How would I make my own templates available via Launcher?
>
> Yes, that's it. Sorry about the wrong terminology!

No problem!
Does the doc answer your needs?
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

Sean P. DeNigris
Administrator
demarey wrote
> Does the doc answer your needs?

It clearly describes current options, but I think I will have to extend,
especially because some of the templates would come from CI for private
projects. I'll keep you posted!



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

demarey

> Le 29 mars 2018 à 19:14, Sean P. DeNigris <[hidden email]> a écrit :
>
> demarey wrote
>> Does the doc answer your needs?
>
> It clearly describes current options, but I think I will have to extend,
> especially because some of the templates would come from CI for private
> projects. I'll keep you posted!


If you want to do so, you can instantiate a PhLJenkins2Server class:
        PhLJenkins2Server name: ’Sean''s Jenkins' url: 'https://jenkins.mine' asZnUrl

Than add it to the groups class method of PhLTemplateGroupRepository.
It should be enough.

This mechanism is not good because everything is hardcoded. The list of displayed sources of templates should be defined in a configuration file instead so that it is easily customizable.
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

CyrilFerlicot
Le 29/03/2018 à 23:13, Christophe Demarey a écrit :
>
> If you want to do so, you can instantiate a PhLJenkins2Server class:
> PhLJenkins2Server name: ’Sean''s Jenkins' url: 'https://jenkins.mine' asZnUrl
>
> Than add it to the groups class method of PhLTemplateGroupRepository.
> It should be enough.
>
> This mechanism is not good because everything is hardcoded. The list of displayed sources of templates should be defined in a configuration file instead so that it is easily customizable.
>

Hi,

I also have a way to add a private Jenkins, but I need to clean it
before integrating it to the Pharo Launcher.

If someone needs the code before I clean it I can share it. Just contact me.

--
Cyril Ferlicot
https://ferlicot.fr


signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

Sean P. DeNigris
Administrator
CyrilFerlicot wrote
> I also have a way to add a private Jenkins, but I need to clean it
> before integrating it to the Pharo Launcher.

Cool :) In my case, I'm wanting to integrate with GitLab CI. That said, I'm
definitely interested in your work (no rush though).



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

demarey

> Le 30 mars 2018 à 01:05, Sean P. DeNigris <[hidden email]> a écrit :
>
> CyrilFerlicot wrote
>> I also have a way to add a private Jenkins, but I need to clean it
>> before integrating it to the Pharo Launcher.
>
> Cool :) In my case, I'm wanting to integrate with GitLab CI. That said, I'm
> definitely interested in your work (no rush though).

We do not yet have support for GitLab but it should be straightforward to do.
What you need is a way to access a zip file containing the resulting image and changes files (either via a ReST API or just plein html urls).
To use plain HTML urlrs, take a look at PhLFixedURLsTemplateGroup and PhLHTTPListingTemplateGroup classes.

If you come with something generic enough, we could add it to the Pharo Launcher so that others can also use it (if you want).
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

Sean P. DeNigris
Administrator
demarey wrote
> We do not yet have support for GitLab but it should be straightforward to
> do.
> What you need is a way to access a zip file…

Since they are private, any ideas how to do the authentication?


demarey wrote
> If you come with something generic enough, we could add it to the Pharo
> Launcher so that others can also use it (if you want).

That's the idea :)



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

CyrilFerlicot
On 30/03/2018 19:40, Sean P. DeNigris wrote:
> demarey wrote
>> We do not yet have support for GitLab but it should be straightforward to
>> do.
>> What you need is a way to access a zip file…
>
> Since they are private, any ideas how to do the authentication?
>

To manage private Jenkins I changed the managements of urls to use a
username and token provided by Jenkins.

Maybe gitlab has such tokens?

>
> demarey wrote
>> If you come with something generic enough, we could add it to the Pharo
>> Launcher so that others can also use it (if you want).
>
> That's the idea :)
> >
>
> -----
> Cheers,
> Sean
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>


--
Cyril Ferlicot
https://ferlicot.fr

Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

Sean P. DeNigris
Administrator
CyrilFerlicot wrote
> Maybe gitlab has such tokens?

Yes, Gitlab artifacts can be accessed that way:

# Reference https://docs.gitlab.com/ee/api/jobs.html#get-job-artifacts
# Project ID available in general settings
curl --location --header "PRIVATE-TOKEN: {tokenID}"
"https://gitlab.com/api/v4/projects/{projectID}/jobs/{jobID}/artifacts"
--output ~/Downloads/download.zip



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

Sean P. DeNigris
Administrator
In reply to this post by CyrilFerlicot
CyrilFerlicot wrote
> I also have a way to add a private Jenkins, but I need to clean it
> before integrating it to the Pharo Launcher.
>
> If someone needs the code before I clean it I can share it. Just contact
> me.

I'm guessing our needs will be quite similar given the url/token approach,
so I can wait until you release. Should I be watching a particular repo?



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

CyrilFerlicot

On sam. 31 mars 2018 at 16:10, Sean P. DeNigris <[hidden email]> wrote:
CyrilFerlicot wrote
> I also have a way to add a private Jenkins, but I need to clean it
> before integrating it to the Pharo Launcher.
>
> If someone needs the code before I clean it I can share it. Just contact
> me.

I'm guessing our needs will be quite similar given the url/token approach,
so I can wait until you release. Should I be watching a particular repo?

I'll not have the time to work on it soon. I sent you the link to the repo on Discord. If others are interested: 

It works so you can take a look. What is not nice is that I subclass all the PharoLauncher hierarchy instead of improving the existing one and there is some work to do on the UI. (Here it can only takes one username/password for all private Jenkins. It should be one pair by private Jenkins) 




-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

--
Cyril Ferlicot
https://ferlicot.fr
Reply | Threaded
Open this post in threaded view
|

Re: Launcher User Templates

demarey
In reply to this post by Sean P. DeNigris

> Le 31 mars 2018 à 06:02, Sean P. DeNigris <[hidden email]> a écrit :
>
> CyrilFerlicot wrote
>> Maybe gitlab has such tokens?
>
> Yes, Gitlab artifacts can be accessed that way:
>
> # Reference https://docs.gitlab.com/ee/api/jobs.html#get-job-artifacts
> # Project ID available in general settings
> curl --location --header "PRIVATE-TOKEN: {tokenID}"
> "https://gitlab.com/api/v4/projects/{projectID}/jobs/{jobID}/artifacts"
> --output ~/Downloads/download.zip
>

To manage auth, you could add a download method to PhLDownloadManager class and use something like:

keyedCollection := { 'PRIVATE-TOKEN’ -> tokenID } asDictionary.

newHTTPClientForUrl: url extraHeaders: keyedCollection
        ^ ZnClient new
                signalProgress: true;
                url: url;
                headerAddAll: keyedCollection
                enforceHttpSuccess: true;
                ifFail: [ :exception | self downloadFailureForUrl: url ];
                yourself