Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions to create a new module #853

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)")"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, nice hack 'abusing' basename!

git pull --prune --quiet
git branch -D modulesync || true
)
done