-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathppg
More file actions
executable file
·61 lines (50 loc) · 1.15 KB
/
ppg
File metadata and controls
executable file
·61 lines (50 loc) · 1.15 KB
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
#!/bin/bash
if [[ -n "${PPG_DEBUG}" ]]; then
set -x
fi
usage() {
echo "Usage: ppg COMMAND [OPTIONS] [TARGET]"
echo
echo "ppg commands are:"
cat <<\EOF | sed -e 's/^/ /'
For development environments
init-devenv Prepares a development/test environment for commits
commit Commits though to git
schedule Schedule a commit for merge to production
For puppet clients
clone Clones and inits a client environment
init Prepares a client environment after a "git clone"
pullapply Updates and applies config updates
apply Apply changes manually
EOF
}
# RHEL6/CentOS6 does not have /usr/bin/realpath
PPG_EXEC_PATH=$( dirname $(readlink -f "${BASH_SOURCE[0]}" ) )
cmd=
case "$#" in
0) usage
;;
*) cmd="$1"
shift
case "$cmd" in
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "ppg version @@PPG_VERSION@@"
exit 0 ;;
-h|--help)
usage
exit 0;;
-*)
echo >&2 "ERROR: Unknown option $cmd"
usage
exit 1;
esac
if [[ -x "$PPG_EXEC_PATH/ppg-$cmd" ]]; then
exec "$PPG_EXEC_PATH/ppg-$cmd" "$@"
exit $?
else
echo >&2 "ERROR: Unknown command $cmd"
usage
exit 1;
fi
;;
esac