Skip to content

Commit 458f313

Browse files
authored
Merge pull request #316 from binford2k/update_module_publish
update module publish
2 parents 3eaae8e + 698ef32 commit 458f313

1 file changed

Lines changed: 51 additions & 75 deletions

File tree

docs/_openvox_8x/modules_publishing.markdown

Lines changed: 51 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,14 @@ title: "Publishing modules on the Puppet Forge"
88
[fundamentals]: ./modules_fundamentals.html
99
[plugins]: ./plugins_in_modules.html
1010
[forge]: https://forge.puppet.com/
11-
[signup]: ./images/forge_signup.png
12-
[publishmodule]: ./images/forge_publish_module.png
13-
[uploadtarball]: ./images/forge_upload_tarball.png
14-
[uploadtarball2]: ./images/forge_upload_tarball2.png
15-
[forgenewrelease]: ./images/forge_new_release.png
1611
[documentation]: ./modules_documentation.html
17-
[selectrelease]: ./images/selectrelease.png
18-
[deletebutton]: ./images/deletebutton.png
19-
[deletionpage]: ./images/deletionpage.png
20-
[deleteconfirmation]: ./images/deleteconfirmation.png
21-
[deletedrelease]: ./images/deletedrelease.png
22-
[delteddownloadwarning]: ./images/delteddownloadwarning.png
23-
[onereleasesearch]: ./images/onereleasesearch.png
24-
[noreleasesearch]: ./images/noreleasesearch.png
25-
[noreleasesearchfilter]: ./images/noreleasesearchfilter.png
2612
[metadata]: ./modules_metadata.html
27-
[pdk]: {{pdk}}/pdk.html
13+
[devkit]: ../../ecosystem/latest/devkit/index.html
14+
[ignore]: https://git-scm.com/docs/gitignore
2815

2916

30-
To share your module with other Puppet users, get contributions to your modules, and maintain your module releases, publish your module on the Puppet Forge. The Forge is a community repository of modules, written and contributed by open source Puppet and Puppet Enterprise users.
17+
To share your module with other Puppet users, get contributions to your modules, and maintain your module releases, publish your module on the Puppet Forge.
18+
The Forge is a community repository of modules, written and contributed by open source Puppet and Puppet Enterprise users.
3119

3220
To publish your module:
3321

@@ -44,18 +32,26 @@ To publish your module:
4432
* [Installing modules][installing]: How to install pre-built modules from the Puppet Forge.
4533
* [Using plugins][plugins]: How to arrange plugins (such as custom facts and custom resource types) in modules and sync them to agent nodes.
4634
* [Documenting modules][documentation]: How to write good documentation for your modules.
47-
* [Puppet Development Kit][pdk]: A package of development and testing tools to help you create great modules.
35+
* [Vox Pupuli Development Kit][devkit]: A package of development and testing tools to help you create great modules.
4836

4937

50-
## Naming your module
38+
## Naming your module
5139

5240
Your module has two names: a short name, like "mysql", and a long name that includes your Forge username, like "puppetlabs-mysql".
5341

54-
To upload to the Forge, use the module long name. This name is composed of your Forge username and the short name of your module. For example, the "puppetlabs" user maintains a "mysql" module, which is known to the Forge as "puppetlabs-mysql". Use this long name in your module's `metadata.json` file. This helps disambiguate modules that might have common short names, such as "mysql" or "apache."
42+
To upload to the Forge, use the module long name.
43+
This name is composed of your Forge username and the short name of your module.
44+
For example, the "puppetlabs" user maintains a "mysql" module, which is known to the Forge as "puppetlabs-mysql".
45+
Use this long name in your module's `metadata.json` file.
46+
This helps disambiguate modules that might have common short names, such as "mysql" or "apache."
5547

56-
However, your module directory on disk must use the short name, without the username prefix. Module directory names cannot contain dashes or periods; only letters, numbers, and underscores. As long as you have the correct long name in your `metadata.json` file, the `puppet module build` command uses the correct names in the correct places.
48+
However, your module directory on disk must use the short name, without the username prefix.
49+
Module directory names cannot contain dashes or periods; only letters, numbers, and underscores.
50+
As long as you have the correct long name in your `metadata.json` file, the `puppet module build` command uses the correct names in the correct places.
51+
52+
{% include alert.html type="note" content="Although the Forge expects to receive modules named `username-module`, its web interface presents them as `username/module`.
53+
Always use the `username-module` style in your metadata files and when issuing commands." %}
5754

58-
> **Note**: Although the Forge expects to receive modules named `username-module`, its web interface presents them as `username/module`. Always use the `username-module` style in your metadata files and when issuing commands.
5955

6056
Related topics:
6157

@@ -77,15 +73,21 @@ Before you build your module package for publishing, you'll need to make sure it
7773

7874
To do this, you'll exclude unnecessary files from your package or repository, remove or ignore any symlinks your module contains, and make sure your `metadata.json` contains the correct information.
7975

80-
>**Note:** In order to successfully publish your module to the Puppet Forge and ensure that everything is rendered correctly, your README, license file, changelog, and metadata.json must be UTF-8 encoded. If you used the Puppet Development Kit (or the deprecated `puppet module generate` command) to create your module, these files are already UTF-8 encoded.
76+
{% include alert.html type="note" content="In order to successfully publish your module to the Puppet Forge and ensure that everything is rendered correctly, your `README`, license file, changelog, and `metadata.json` must be UTF-8 encoded.
77+
If you used modern tooling to create your module, these files are already UTF-8 encoded." %}
78+
8179

8280
### Excluding files from the package
8381

84-
To exclude certain files from your module build, include them in either a `.gitignore` or a `.pmtignore` file. This is useful for excluding files that are not needed to run the module, such as files generated by spec tests. The ignore file must be in the root directory.
82+
It can be useful to exclude files that are not needed to run the module, such as files generated by spec tests.
83+
This can reduce the size of your generated module or reduce user clutter, for example.
84+
To exclude files, add them to an [ignore file][ignore] in the root directory.
85+
Files in `.pdkignore` will be excluded from module builds.
86+
Files in `.gitignore` will be excluded from modules and also from git, unless specifically added.
8587

86-
#### .pmtignore example
88+
#### `.pdkignore` example
8789

88-
```
90+
```text
8991
import/
9092
/spec/fixtures/
9193
.tmp
@@ -101,52 +103,54 @@ junit/
101103
tmp/
102104
```
103105

104-
The `.pmtignore` file excludes files during `puppet module build` only. For example, you might want spec tests in your source control but not in your module package, so you would list them in `.pmtignore`. To prevent files, such as those in temporary directories, from ever being checked into Git, use `.gitignore`.
106+
The `.pdkignore` file excludes files during `jig module build` only.
107+
For example, you might want spec tests in your source control but not in your module package, so you would list them in `.pdkignore`.
108+
To prevent files, such as those in temporary directories, from ever being checked into Git, use `.gitignore`.
105109

106-
If you have both a `.pmtignore` and a `.gitignore` file, the `puppet module` command uses the `.pmtignore` file.
110+
If you have both a `.pdkignore` and a `.gitignore` file, the `jig module` command uses the `.pdkignore` file.
107111

108112
### Removing symlinks from your module
109113

110-
Symlinks in modules are unsupported. If your module contains symlinks, either remove them or ignore them before you build your module.
114+
Symlinks in modules are unsupported.
115+
If your module contains symlinks, either remove them or ignore them before you build your module.
111116

112-
If you try to build a module package that contains symlinks, you will receive the following error:
117+
{% include alert.html type="warning" content="If you try to build a module package that contains symlinks, you will receive an warning informing you to remove them.
118+
They will not be included in the module package." %}
113119

114-
```
115-
Warning: Symlinks in modules are unsupported. Please investigate symlink manifests/foo.pp->manifests/init.pp.
116-
Error: Found symlinks. Symlinks in modules are not allowed, please remove them.
117-
Error: Try 'puppet help module build' for usage
118-
```
119120

120121
### Adding module metadata in `metadata.json`
121122

122123
To publish your module on the Forge, it must contain required metadata in a `metadata.json` file.
123124

124-
If you generated your module using the Puppet Development Kit or the deprecated `puppet module generate` command, you'll already have a `metadata.json` file. Check it and make any necessary edits.
125+
If you generated your module using modern tooling, you'll already have a `metadata.json` file.
126+
Check it and make any necessary edits.
125127

126-
If you assembled your module manually, you must make sure that you have a `metadata.json` file in your module's main directory. For details on writing or editing the `metadata.json` file, see the related topic about module metadata.
128+
If you assembled your module manually, you must make sure that you have a `metadata.json` file in your module's main directory.
129+
For details on writing or editing the `metadata.json` file, see the related topic about module metadata.
127130

128-
> **Modulefiles**
129-
>
130-
> If you maintain older modules, you might find the metadata stored in a Modulefile. Move any metadata contained in the Modulefile to the `metadata.json`. Modulefiles were deprecated in Puppet 3 and removed in Puppet 4. They are now treated like any other text file in the root directory of the module.
131+
{% include alert.html type="warning" content="If you maintain very old modules, you might find the metadata stored in a `Modulefile`.
132+
Move any metadata contained in the `Modulefile` to `metadata.json`.
133+
Modulefiles were deprecated in Puppet 3 and removed in Puppet 4.
134+
They are now treated like any other text file in the root directory of the module." %}
131135

132136
Related topics:
133137

134138
* [Module metadata and `metadata.json`][metadata]
135139
* [Semantic versioning](http://semver.org/)
136140

137141

138-
## Build your module
142+
## Build your module
139143

140144
To upload your module to the Forge, you first must build the module package.
141145

142-
1. From the command line, run `puppet module build <MODULE DIRECTORY>`. This command generates a `.tar.gz` package and saves it in the module's `pkg/` subdirectory.
146+
1. From the command line in your module's root directory, run `jig build build`. This command generates a `.tar.gz` package and saves it in the module's `pkg/` subdirectory.
143147

144148
For example:
145149

146-
```
147-
# puppet module build /etc/puppetlabs/puppet/modules/mymodule
148-
Building /etc/puppetlabs/puppet/modules/mymodule for release
149-
/etc/puppetlabs/puppet/modules/mymodule/pkg/examplecorp-mymodule-0.0.1.tar.gz
150+
```console
151+
$ cd /etc/puppetlabs/puppet/modules/mymodule
152+
$ jig build
153+
built /home/user/modules/mymodule/pkg/examplecorp-mymodule-0.0.1.tar.gz
150154
```
151155

152156
## Upload a module to the Forge
@@ -161,37 +165,9 @@ Your module package should be a compiled `tar.gz` package of 10MB or less.
161165

162166
4. On the upload page, click **Choose File** and use the file browser to locate and select the release tarball. Then click **Upload Release**.
163167

164-
After a successful upload, your browser should load the new release page of your module, with any errors popping up on the same screen. Your module's README, Changelog,and License files are displayed on your module's Forge page.
165-
166-
## Publish to the Forge automatically with Travis CI
167-
168-
You can automatically publish new versions of your module to the Forge using Travis CI.
169-
170-
First, set up Travis CI for automatic publishing.
171-
172-
1. Enable Travis CI for the module repository.
173-
2. Generate a Travis-encrypted Forge password string. For instructions, see the Travis CI [encryption keys docs](https://docs.travis-ci.com/user/encryption-keys/).
174-
3. Create a `.travis.yml` file in the module's repository base. This file should have a deployment section that includes your Forge username and the encrypted Forge password, such as:
175-
176-
```
177-
deploy:
178-
provider: puppetforge
179-
user: <FORGE_USER>
180-
password:
181-
secure: "<ENCRYPTED_FORGE_PASSWORD>"
182-
on:
183-
tags: true
184-
# all_branches is required to use tags
185-
all_branches: true
186-
```
187-
188-
To publish to the Forge with Travis CI, update your version, tag your repo, and push your commit.
189-
190-
1. Update the version number in the module's `metadata.json` file and commit the change to the module repository.
191-
2. Tag the module repo with the desired version number. For more information about how to do this, see Git docs on [basic tagging](https://git-scm.com/book/en/v2/Git-Basics-Tagging).
192-
3. Push the commit and tag to your Git repository.
168+
After a successful upload, your browser should load the new release page of your module, with any errors popping up on the same screen.
169+
Your module's README, Changelog,and License files are displayed on your module's Forge page.
193170

194-
Travis CI will build and publish the module.
195171

196172
## Deprecate a module on the Forge
197173

0 commit comments

Comments
 (0)