diff --git a/README.md b/README.md index 0df2a5eb..56919e17 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin/clean-git-checkouts b/bin/clean-git-checkouts index e3da5711..37443ad3 100755 --- a/bin/clean-git-checkouts +++ b/bin/clean-git-checkouts @@ -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