Browse Source

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
changes/53/627553/4
Tobias Urdin 6 months ago
parent
commit
20583c1e77

+ 22
- 0
roles/upload-puppetforge/README.rst View File

@@ -0,0 +1,22 @@
1
+Upload 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.

+ 3
- 0
roles/upload-puppetforge/defaults/main.yaml View File

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

+ 21
- 0
roles/upload-puppetforge/tasks/main.yaml View File

@@ -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 }}"

Loading…
Cancel
Save