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:
parent
21ea7e8384
commit
20583c1e77
22
roles/upload-puppetforge/README.rst
Normal file
22
roles/upload-puppetforge/README.rst
Normal 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.
|
3
roles/upload-puppetforge/defaults/main.yaml
Normal file
3
roles/upload-puppetforge/defaults/main.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
puppet_module_dir: "{{ zuul.project.src_dir }}"
|
||||
blacksmith_forge_url: "https://forgeapi.puppetlabs.com"
|
21
roles/upload-puppetforge/tasks/main.yaml
Normal file
21
roles/upload-puppetforge/tasks/main.yaml
Normal 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 }}"
|
Loading…
Reference in New Issue
Block a user