Skip to content

Commit d030979

Browse files
committed
Add script to adjust modules afer dep got migrated
the camptocamp/systemd module is now voxpupuli/systemd. I wrote a script to update the namespace in .fixtures.yml, the namespace and upper version in metadata.json and to create a pull request afterwards. Call it like this: ``` export GITHUB_TOKEN=... ./bin/clean-git-checkouts ./bin/systemd_module_migration.sh ``` This script can be adjusted for other modules. None of our modules install the systemd module in spec/spec_helper_acceptance.rb nor spec/acceptance/*, so I didn't implement this.
1 parent 2f5249d commit d030979

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

bin/systemd_module_migration.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
if ! which hub > /dev/null ; then
4+
echo "We require hub later on for the PR" >&2
5+
exit 1
6+
fi
7+
8+
# fix all modules with systemd in .fixtures.yml
9+
sed --in-place 's#camptocamp/puppet-systemd#voxpupuli/puppet-systemd#' modules/voxpupuli/puppet-*/.fixtures.yml
10+
11+
# identify all modules with systemd from camptocamp in their metadata.json
12+
sed --in-place 's#camptocamp[-,/]systemd#puppet/systemd#' modules/voxpupuli/puppet-*/metadata.json
13+
14+
# bump the metadata because there was a recent major release
15+
./bin/bump-dependency-upper-bound puppet/systemd 4.0.0 modules/voxpupuli/puppet-*/metadata.json
16+
17+
# commit and create a PR
18+
for module in modules/voxpupuli/puppet-* ; do
19+
(cd "$module"
20+
git diff --exit-code .fixtures.yml metadata.json
21+
if [ $? != 0 ] ; then
22+
git checkout -b systemd_voxpupuli origin/master
23+
git commit -am 'switch from camptocamp/systemd to voxpupuli/systemd'
24+
git push --set-upstream origin HEAD
25+
# export GITHUB_TOKEN=... https://hub.github.com/hub.1.html
26+
hub pull-request -m 'switch from camptocamp/systemd to voxpupuli/systemd'
27+
fi
28+
)
29+
done

0 commit comments

Comments
 (0)