summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Urdin <tobias.urdin@binero.se>2018-12-27 20:50:08 +0100
committerTobias Urdin <tobias.urdin@binero.se>2019-01-14 12:30:00 +0100
commit20583c1e77e332ee912da0704baba214dd036c5f (patch)
treee199deca41713d40748c0580e18755e375599bb5
parent21ea7e83848f9f7d755c14c184858b328842bf33 (diff)
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
Notes
Notes (review): Code-Review+1: Sorin Sbarnea <ssbarnea@redhat.com> Code-Review+2: Andreas Jaeger <jaegerandi@gmail.com> Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Workflow+1: Clark Boylan <cboylan@sapwetik.org> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 14 Jan 2019 17:17:31 +0000 Reviewed-on: https://review.openstack.org/627553 Project: openstack-infra/zuul-jobs Branch: refs/heads/master
-rw-r--r--roles/upload-puppetforge/README.rst22
-rw-r--r--roles/upload-puppetforge/defaults/main.yaml3
-rw-r--r--roles/upload-puppetforge/tasks/main.yaml21
3 files changed, 46 insertions, 0 deletions
diff --git a/roles/upload-puppetforge/README.rst b/roles/upload-puppetforge/README.rst
new file mode 100644
index 0000000..5eae36a
--- /dev/null
+++ b/roles/upload-puppetforge/README.rst
@@ -0,0 +1,22 @@
1Upload puppet module to Puppet Forge
2
3**Role Variables**
4
5 .. zuul:rolevar:: puppet_module_dir
6 :default: {{ zuul.project.src_dir }}
7
8 The folder where the puppet module code is that it can
9 switch folder to.
10
11 .. zuul:rolevar:: blacksmith_forge_url
12 :default: https://forgeapi.puppetlabs.com
13
14 The URL to the Puppet Forge API.
15
16 .. zuul:rolevar:: blacksmith_forge_username
17
18 Username to use to log in to Puppet Forge.
19
20 .. zuul:rolevar:: blacksmith_forge_password
21
22 Password to use to log in to Puppet Forge.
diff --git a/roles/upload-puppetforge/defaults/main.yaml b/roles/upload-puppetforge/defaults/main.yaml
new file mode 100644
index 0000000..c93ad60
--- /dev/null
+++ b/roles/upload-puppetforge/defaults/main.yaml
@@ -0,0 +1,3 @@
1---
2puppet_module_dir: "{{ zuul.project.src_dir }}"
3blacksmith_forge_url: "https://forgeapi.puppetlabs.com"
diff --git a/roles/upload-puppetforge/tasks/main.yaml b/roles/upload-puppetforge/tasks/main.yaml
new file mode 100644
index 0000000..52fa288
--- /dev/null
+++ b/roles/upload-puppetforge/tasks/main.yaml
@@ -0,0 +1,21 @@
1- name: Install required gems
2 gem:
3 name: "{{ item }}"
4 with_items:
5 - rake
6 - puppetlabs_spec_helper
7 - puppet-blacksmith
8
9- name: Install new Rakefile
10 copy:
11 content: "require 'puppet_blacksmith/rake_tasks'"
12 dest: "{{ puppet_module_dir }}/Rakefile"
13
14- name: Publish puppet module
15 command: "rake module:push"
16 args:
17 chdir: "{{ puppet_module_dir }}"
18 environment:
19 BLACKSMITH_FORGE_URL: "{{ blacksmith_forge_url }}"
20 BLACKSMITH_FORGE_USERNAME: "{{ blacksmith_forge_username }}"
21 BLACKSMITH_FORGE_PASSWORD: "{{ blacksmith_forge_password }}"