Is there a way to publish a module via the Forge API?

34 views
Skip to first unread message

Amos Shapira

unread,
May 20, 2016, 4:51:38 AM5/20/16
to Puppet Users
Hello,

I didn't find a way to upload a module to the Forge using the Forge API. Is this possible?

I find it a bit weird that a tool which advocates "infrastructure as code" doesn't cater for options to script module uploads.

Am I missing something?

Thanks.

Gareth Rushgrove

unread,
May 20, 2016, 7:48:16 AM5/20/16
to puppet...@googlegroups.com
Hi Amos

On 20 May 2016 at 05:51, Amos Shapira <amos.s...@gmail.com> wrote:
> Hello,
>
> I didn't find a way to upload a module to the Forge using the Forge API. Is
> this possible?
>
> I find it a bit weird that a tool which advocates "infrastructure as code"
> doesn't cater for options to script module uploads.
>

It is indeed possible. Better that possible, there is even have a
handy tool that provides a nice user interface for doing so.

https://github.com/voxpupuli/puppet-blacksmith

Blacksmith provides a number of useful commands for determining how
you want to go about releasing your modules. The simplest is to just
run:

rake module:release

The README has lots more details.

Gareth


> Am I missing something?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/8cbb7e19-dbf8-4f06-9a52-76ebb5c24287%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Gareth Rushgrove
@garethr

devopsweekly.com
morethanseven.net
garethrushgrove.com

Rob Nelson

unread,
May 20, 2016, 11:08:14 AM5/20/16
to Puppet Users
I love blacksmith, it's great. It does require the forge password be known to the person running it, however.

You can "level up" your deployments to allow others with write access to your repo, but not the forge credentials, in a mature pipeline with Travis CI's automated deployments. Details on puppetforge deploys, and an example of a working .travis.yml (the secure string is generated by travis encrypt). This allows any contributor to create a tag (usually with the voxpupuli-release gem and `rake travis_release`, but also by creating a tag on GitHub). Travis kicks off a build on the tag, and if the test specified in the deploy section goes green, your module is published to the forge. That might be overkill for a module maintained by one person, but it is pretty neat when you have a distributed team and can't/don't want to share the forge password with everyone.

I'm sure you could get the same thing working with other services than GitHub/Travis CI, those are just the pair I know.

Corey Osman

unread,
May 20, 2016, 3:41:24 PM5/20/16
to Puppet Users
Have you seen the dpl gem?

https://github.com/travis-ci/dpl#puppet-forge


Corey

Amos Shapira

unread,
May 20, 2016, 9:33:40 PM5/20/16
to Puppet Users
Thanks Rob.

We don't use Travis or Github and for now I'm the only one maintaining the module. We use Blackbox (https://github.com/StackExchange/blackbox) and hiera-eyaml-gpg (https://github.com/sihil/hiera-eyaml-gpg) to store shared secrets. If we get to doing this through our self-hosted Jenkins server then I'll probably look at providing the password to the job using the Credentials Plugin (https://cloudbees.zendesk.com/hc/en-us/articles/203802500-Injecting-Secrets-into-Jenkins-Build-Jobs).

Cheers.

Amos Shapira

unread,
May 20, 2016, 9:34:50 PM5/20/16
to Puppet Users
No I haven't. This looks interesting especially if I could take advantage of it to deploy to private repos too (Gemfury.com or self-hosted Nexus, for instance)
Reply all
Reply to author
Forward
0 new messages