forked from kisspuppet/puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule_package.sh
64 lines (51 loc) · 1.06 KB
/
module_package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
work_dir=/tmp/
showhelp () {
cat << EOF
This script tags, checks and packages a module to be published on the Forge. You should have already created, on the Forge, a module, under your account, with the same name.
Example:
$0 -m module_name -v "version"
EOF
}
while [ $# -gt 0 ]; do
case "$1" in
-m)
module=$2
shift 2 ;;
-t)
tag=$2
shift 2 ;;
-n)
notes=$2
shift 2 ;;
-v)
version=$2
shift 2 ;;
esac
done
if [ ! $module ] ; then
echo "Insert the module name"
read module
fi
if [ ! -f $module/manifests/init.pp ] ; then
echo "I don't find $module/manifests/init.pp "
echo "Run this script from the base modules directory and specify a valid module name"
showhelp
exit 1
fi
version=$(grep version $module/Modulefile | cut -d "'" -f 2)
if [ ! $version ] ; then
echo "Write the release version"
read version
fi
cd $module
../Example42-tools/check-module.sh
echo
echo
cd ..
puppet module build $module
echo
echo
echo "Tagging module with version $version"
cd $module
git tag $version