Add upload-puppetforge role

Adds a new role that can be used to upload a
built puppet module tarball to forge.puppet.com

Change-Id: I16c4da93592dc92b84ff8ad9540c75c7d3b39a91
This commit is contained in:
Tobias Urdin 2018-12-27 20:50:08 +01:00
parent 21ea7e8384
commit 20583c1e77
3 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,22 @@
Upload puppet module to Puppet Forge
**Role Variables**
.. zuul:rolevar:: puppet_module_dir
:default: {{ zuul.project.src_dir }}
The folder where the puppet module code is that it can
switch folder to.
.. zuul:rolevar:: blacksmith_forge_url
:default: https://forgeapi.puppetlabs.com
The URL to the Puppet Forge API.
.. zuul:rolevar:: blacksmith_forge_username
Username to use to log in to Puppet Forge.
.. zuul:rolevar:: blacksmith_forge_password
Password to use to log in to Puppet Forge.

View File

@ -0,0 +1,3 @@
---
puppet_module_dir: "{{ zuul.project.src_dir }}"
blacksmith_forge_url: "https://forgeapi.puppetlabs.com"

View File

@ -0,0 +1,21 @@
- name: Install required gems
gem:
name: "{{ item }}"
with_items:
- rake
- puppetlabs_spec_helper
- puppet-blacksmith
- name: Install new Rakefile
copy:
content: "require 'puppet_blacksmith/rake_tasks'"
dest: "{{ puppet_module_dir }}/Rakefile"
- name: Publish puppet module
command: "rake module:push"
args:
chdir: "{{ puppet_module_dir }}"
environment:
BLACKSMITH_FORGE_URL: "{{ blacksmith_forge_url }}"
BLACKSMITH_FORGE_USERNAME: "{{ blacksmith_forge_username }}"
BLACKSMITH_FORGE_PASSWORD: "{{ blacksmith_forge_password }}"