Skip to content

Commit

Permalink
Merge pull request #853 from ekohl/add-instructions-for-new-module
Browse files Browse the repository at this point in the history
Add instructions to create a new module
  • Loading branch information
ekohl authored Oct 9, 2023
2 parents ad43c7f + d5b76eb commit a2ab07e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,32 @@ export GITHUB_TOKEN=token
bundle exec msync update --message "modulesync $(git describe)" --pr --pr-labels modulesync --pr-title "modulesync $(git describe)"
```

### Create a new module

It is possible to create a new module using msync.
First add it to the list of modules in `managed_modules.yml`.
If it's not in the voxpupuli namespace, be sure to include yours by using `mynamespace/puppet-module`.
Then use an offline update to create the structure:

```bash
bundle exec msync update --offline -f puppet-mymodule
```

Now a new directory `modules/mynamespace/puppet-mymodule` will be created.

Initialize git and push it to your location:

```bash
cd modules/mynamespace/puppet-mymodule
git init
git add .
git commit -m 'Add module skeleton'
git remote add origin git@github.com:mynamespace/puppet-mymodule
git push origin HEAD -u
```

Now proceed with the regular module work, such as creating `metadata.json` and your manifests.

### Clean up old mess before syncing

```bash
Expand Down
8 changes: 4 additions & 4 deletions bin/clean-git-checkouts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

set -e

for module in modules/*/* ; do
(cd $module
for module in modules/voxpupuli/* ; do
(cd "$module"
git status
git reset --hard
git clean -dfx
git checkout master
git pull --prune
git checkout "$(basename "$(git symbolic-ref refs/remotes/origin/HEAD)")"
git pull --prune --quiet
git branch -D modulesync || true
)
done

0 comments on commit a2ab07e

Please sign in to comment.