alpha_omega 0.0.111 → 0.0.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.mkd +8 -6
- data/VERSION +1 -1
- data/lib/alpha_omega/deploy/scm/git.rb +2 -1
- data/lib/alpha_omega/deploy.rb +27 -27
- data/lib/alpha_omega/utils.rb +10 -19
- data/libexec/activate +82 -15
- data/libexec/build +82 -15
- data/libexec/bump +162 -0
- data/libexec/check +82 -15
- data/libexec/compare +82 -15
- data/libexec/config +82 -15
- data/libexec/debug +82 -15
- data/libexec/deploy +82 -15
- data/libexec/dist +82 -15
- data/libexec/dna +82 -15
- data/libexec/hosts +82 -15
- data/libexec/invoke +82 -15
- data/libexec/lock +162 -0
- data/libexec/plan +162 -0
- data/libexec/proxy +2 -1
- data/libexec/release +82 -15
- data/libexec/restart +82 -15
- data/libexec/rollback +82 -15
- data/libexec/shell +82 -15
- data/libexec/stage +82 -15
- data/libexec/unlock +162 -0
- metadata +7 -3
data/libexec/plan
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
#!/bin/bash -e
|
2
|
+
|
3
|
+
hst_this=$(hostname -s)
|
4
|
+
if ! echo "$hst_this" | egrep -q "^(admin|develop)"; then
|
5
|
+
# unless the .ao_no_proxy file exists
|
6
|
+
if [[ ! -f ".ao_no_proxy" ]]; then
|
7
|
+
# ssh into deploy host and run from there
|
8
|
+
exec bin/proxy $(basename $0) "$@"
|
9
|
+
exit 1
|
10
|
+
fi
|
11
|
+
fi
|
12
|
+
|
13
|
+
case "$(basename $0)" in
|
14
|
+
debug)
|
15
|
+
export LOCAL_ONLY=true
|
16
|
+
|
17
|
+
{
|
18
|
+
cap $(for a in "$@"; do echo $a.echo; done)
|
19
|
+
}
|
20
|
+
;;
|
21
|
+
|
22
|
+
hosts)
|
23
|
+
export LOCAL_ONLY=true
|
24
|
+
|
25
|
+
{
|
26
|
+
cap $(for a in "$@"; do echo $a.echo; done)
|
27
|
+
} 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | awk '{print $NF}' | sort -u
|
28
|
+
;;
|
29
|
+
|
30
|
+
dna)
|
31
|
+
export LOCAL_ONLY=true
|
32
|
+
|
33
|
+
{
|
34
|
+
echo "eea914aaa8dde6fdae29242b1084a2b0415eefaf ---"
|
35
|
+
cap $(for a in "$@"; do echo $a.yaml; done)
|
36
|
+
} 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | sed 's#eea914aaa8dde6fdae29242b1084a2b0415eefaf ##'
|
37
|
+
;;
|
38
|
+
|
39
|
+
bump)
|
40
|
+
case "$1" in
|
41
|
+
patch|minor|major)
|
42
|
+
bump=$1; shift
|
43
|
+
set $(cat VERSION | sed 's#\.# #g')
|
44
|
+
case "$bump" in
|
45
|
+
patch)
|
46
|
+
echo "$1.$2.$(($3 + 1))"
|
47
|
+
;;
|
48
|
+
minor)
|
49
|
+
echo "$1.$(($2 + 1)).0"
|
50
|
+
;;
|
51
|
+
major)
|
52
|
+
echo "$(($1 + 1)).0.0"
|
53
|
+
;;
|
54
|
+
esac > VERSION
|
55
|
+
;;
|
56
|
+
*)
|
57
|
+
ver_new=$1; shift
|
58
|
+
set $(echo "$ver_new" | sed 's#\.# #g') 0
|
59
|
+
M=$1; shift
|
60
|
+
m=$1; shift
|
61
|
+
p=$1; shift
|
62
|
+
|
63
|
+
tmp_version=$(mktemp -t XXXXXXXXX)
|
64
|
+
(echo "$(($M+0)).$(($m+0)).$(($p+0))" > $tmp_version) 2>&-
|
65
|
+
ver_new_same=$(cat $tmp_version)
|
66
|
+
rm -f $tmp_version
|
67
|
+
|
68
|
+
if [[ $ver_new = $ver_new_same ]]; then
|
69
|
+
echo "$ver_new" > VERSION
|
70
|
+
else
|
71
|
+
echo "ERROR: invalid version: $ver_new" 1>&2
|
72
|
+
exit 1
|
73
|
+
fi
|
74
|
+
;;
|
75
|
+
esac
|
76
|
+
|
77
|
+
if [[ -f Gemfile ]]; then
|
78
|
+
bundle check 2>&1 >/dev/null || { bundle --quiet install --local --path vendor/bundle || bundle check > /dev/null; }
|
79
|
+
git add Gemfile.lock
|
80
|
+
fi
|
81
|
+
|
82
|
+
git add VERSION
|
83
|
+
|
84
|
+
ver_bumped=$(cat VERSION)
|
85
|
+
git commit -m "bump: $ver_bumped"
|
86
|
+
git tag "v$ver_bumped"
|
87
|
+
echo $ver_bumped
|
88
|
+
;;
|
89
|
+
|
90
|
+
*)
|
91
|
+
set $(for a in "$@"; do echo $a.app; done)
|
92
|
+
case "$(basename $0)" in
|
93
|
+
deploy)
|
94
|
+
bundle exec cap "$@" deploy
|
95
|
+
;;
|
96
|
+
|
97
|
+
release)
|
98
|
+
bundle exec cap "$@" deploy
|
99
|
+
;;
|
100
|
+
|
101
|
+
stage)
|
102
|
+
bundle exec cap "$@" deploy:update_code
|
103
|
+
;;
|
104
|
+
|
105
|
+
restart)
|
106
|
+
bundle exec cap "$@" deploy:restart
|
107
|
+
;;
|
108
|
+
|
109
|
+
config)
|
110
|
+
bundle exec cap "$@" deploy:config
|
111
|
+
;;
|
112
|
+
|
113
|
+
build)
|
114
|
+
bundle exec cap "$@" deploy:build
|
115
|
+
;;
|
116
|
+
|
117
|
+
dist)
|
118
|
+
bundle exec cap "$@" deploy:dist
|
119
|
+
;;
|
120
|
+
|
121
|
+
activate)
|
122
|
+
bundle exec cap "$@" deploy:symlink deploy:restart
|
123
|
+
;;
|
124
|
+
|
125
|
+
rollback)
|
126
|
+
bundle exec cap "$@" deploy:rollback
|
127
|
+
;;
|
128
|
+
|
129
|
+
check)
|
130
|
+
bundle exec cap "$@" deploy:check
|
131
|
+
;;
|
132
|
+
|
133
|
+
compare)
|
134
|
+
bundle exec cap "$@" deploy:compare
|
135
|
+
;;
|
136
|
+
|
137
|
+
plan)
|
138
|
+
bundle exec cap "$@" deploy:plan
|
139
|
+
;;
|
140
|
+
|
141
|
+
lock)
|
142
|
+
bundle exec cap "$@" deploy:lock
|
143
|
+
;;
|
144
|
+
|
145
|
+
unlock)
|
146
|
+
bundle exec cap "$@" deploy:unlock
|
147
|
+
;;
|
148
|
+
|
149
|
+
invoke)
|
150
|
+
bundle exec cap "$@" invoke
|
151
|
+
;;
|
152
|
+
|
153
|
+
shell)
|
154
|
+
bundle exec cap "$@" shell
|
155
|
+
;;
|
156
|
+
|
157
|
+
*)
|
158
|
+
bundle exec cap "$@"
|
159
|
+
;;
|
160
|
+
esac
|
161
|
+
esac
|
162
|
+
|
data/libexec/proxy
CHANGED
@@ -4,6 +4,7 @@ hst_proxy="${GATEWAY:=deploy}"
|
|
4
4
|
|
5
5
|
# remote arguments
|
6
6
|
git_url="$(git config --list | grep remote.origin.url | cut -d= -f2-)"
|
7
|
+
git_branch="$(git branch | grep '^\*' | awk '{print $2}' | head -1)"
|
7
8
|
git_head="$(git show HEAD | head -1 | grep ^commit | awk '{print $2}')"
|
8
9
|
|
9
10
|
if [[ -z $git_head ]]; then
|
@@ -11,4 +12,4 @@ if [[ -z $git_head ]]; then
|
|
11
12
|
exit 1
|
12
13
|
fi
|
13
14
|
|
14
|
-
ssh -t $hst_proxy alpha_omega_proxy_helper "$USER" "$git_url" "$git_head" "$@"
|
15
|
+
ssh -t $hst_proxy alpha_omega_proxy_helper "$USER" "$git_url" "$git_branch:$git_head" "$@"
|
data/libexec/release
CHANGED
@@ -36,35 +36,78 @@ case "$(basename $0)" in
|
|
36
36
|
} 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | sed 's#eea914aaa8dde6fdae29242b1084a2b0415eefaf ##'
|
37
37
|
;;
|
38
38
|
|
39
|
+
bump)
|
40
|
+
case "$1" in
|
41
|
+
patch|minor|major)
|
42
|
+
bump=$1; shift
|
43
|
+
set $(cat VERSION | sed 's#\.# #g')
|
44
|
+
case "$bump" in
|
45
|
+
patch)
|
46
|
+
echo "$1.$2.$(($3 + 1))"
|
47
|
+
;;
|
48
|
+
minor)
|
49
|
+
echo "$1.$(($2 + 1)).0"
|
50
|
+
;;
|
51
|
+
major)
|
52
|
+
echo "$(($1 + 1)).0.0"
|
53
|
+
;;
|
54
|
+
esac > VERSION
|
55
|
+
;;
|
56
|
+
*)
|
57
|
+
ver_new=$1; shift
|
58
|
+
set $(echo "$ver_new" | sed 's#\.# #g') 0
|
59
|
+
M=$1; shift
|
60
|
+
m=$1; shift
|
61
|
+
p=$1; shift
|
62
|
+
|
63
|
+
tmp_version=$(mktemp -t XXXXXXXXX)
|
64
|
+
(echo "$(($M+0)).$(($m+0)).$(($p+0))" > $tmp_version) 2>&-
|
65
|
+
ver_new_same=$(cat $tmp_version)
|
66
|
+
rm -f $tmp_version
|
67
|
+
|
68
|
+
if [[ $ver_new = $ver_new_same ]]; then
|
69
|
+
echo "$ver_new" > VERSION
|
70
|
+
else
|
71
|
+
echo "ERROR: invalid version: $ver_new" 1>&2
|
72
|
+
exit 1
|
73
|
+
fi
|
74
|
+
;;
|
75
|
+
esac
|
76
|
+
|
77
|
+
if [[ -f Gemfile ]]; then
|
78
|
+
bundle check 2>&1 >/dev/null || { bundle --quiet install --local --path vendor/bundle || bundle check > /dev/null; }
|
79
|
+
git add Gemfile.lock
|
80
|
+
fi
|
81
|
+
|
82
|
+
git add VERSION
|
83
|
+
|
84
|
+
ver_bumped=$(cat VERSION)
|
85
|
+
git commit -m "bump: $ver_bumped"
|
86
|
+
git tag "v$ver_bumped"
|
87
|
+
echo $ver_bumped
|
88
|
+
;;
|
89
|
+
|
39
90
|
*)
|
40
91
|
set $(for a in "$@"; do echo $a.app; done)
|
41
92
|
case "$(basename $0)" in
|
42
|
-
deploy
|
93
|
+
deploy)
|
43
94
|
bundle exec cap "$@" deploy
|
44
95
|
;;
|
45
96
|
|
46
|
-
|
47
|
-
bundle exec cap "$@" deploy
|
97
|
+
release)
|
98
|
+
bundle exec cap "$@" deploy
|
48
99
|
;;
|
49
100
|
|
50
101
|
stage)
|
51
102
|
bundle exec cap "$@" deploy:update_code
|
52
103
|
;;
|
53
104
|
|
54
|
-
activate)
|
55
|
-
bundle exec cap "$@" deploy:symlink deploy:restart
|
56
|
-
;;
|
57
|
-
|
58
|
-
compare)
|
59
|
-
bundle exec cap "$@" deploy:compare
|
60
|
-
;;
|
61
|
-
|
62
105
|
restart)
|
63
106
|
bundle exec cap "$@" deploy:restart
|
64
107
|
;;
|
65
108
|
|
66
|
-
|
67
|
-
bundle exec cap "$@" deploy:
|
109
|
+
config)
|
110
|
+
bundle exec cap "$@" deploy:config
|
68
111
|
;;
|
69
112
|
|
70
113
|
build)
|
@@ -75,8 +118,32 @@ case "$(basename $0)" in
|
|
75
118
|
bundle exec cap "$@" deploy:dist
|
76
119
|
;;
|
77
120
|
|
78
|
-
|
79
|
-
bundle exec cap "$@" deploy:
|
121
|
+
activate)
|
122
|
+
bundle exec cap "$@" deploy:symlink deploy:restart
|
123
|
+
;;
|
124
|
+
|
125
|
+
rollback)
|
126
|
+
bundle exec cap "$@" deploy:rollback
|
127
|
+
;;
|
128
|
+
|
129
|
+
check)
|
130
|
+
bundle exec cap "$@" deploy:check
|
131
|
+
;;
|
132
|
+
|
133
|
+
compare)
|
134
|
+
bundle exec cap "$@" deploy:compare
|
135
|
+
;;
|
136
|
+
|
137
|
+
plan)
|
138
|
+
bundle exec cap "$@" deploy:plan
|
139
|
+
;;
|
140
|
+
|
141
|
+
lock)
|
142
|
+
bundle exec cap "$@" deploy:lock
|
143
|
+
;;
|
144
|
+
|
145
|
+
unlock)
|
146
|
+
bundle exec cap "$@" deploy:unlock
|
80
147
|
;;
|
81
148
|
|
82
149
|
invoke)
|
data/libexec/restart
CHANGED
@@ -36,35 +36,78 @@ case "$(basename $0)" in
|
|
36
36
|
} 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | sed 's#eea914aaa8dde6fdae29242b1084a2b0415eefaf ##'
|
37
37
|
;;
|
38
38
|
|
39
|
+
bump)
|
40
|
+
case "$1" in
|
41
|
+
patch|minor|major)
|
42
|
+
bump=$1; shift
|
43
|
+
set $(cat VERSION | sed 's#\.# #g')
|
44
|
+
case "$bump" in
|
45
|
+
patch)
|
46
|
+
echo "$1.$2.$(($3 + 1))"
|
47
|
+
;;
|
48
|
+
minor)
|
49
|
+
echo "$1.$(($2 + 1)).0"
|
50
|
+
;;
|
51
|
+
major)
|
52
|
+
echo "$(($1 + 1)).0.0"
|
53
|
+
;;
|
54
|
+
esac > VERSION
|
55
|
+
;;
|
56
|
+
*)
|
57
|
+
ver_new=$1; shift
|
58
|
+
set $(echo "$ver_new" | sed 's#\.# #g') 0
|
59
|
+
M=$1; shift
|
60
|
+
m=$1; shift
|
61
|
+
p=$1; shift
|
62
|
+
|
63
|
+
tmp_version=$(mktemp -t XXXXXXXXX)
|
64
|
+
(echo "$(($M+0)).$(($m+0)).$(($p+0))" > $tmp_version) 2>&-
|
65
|
+
ver_new_same=$(cat $tmp_version)
|
66
|
+
rm -f $tmp_version
|
67
|
+
|
68
|
+
if [[ $ver_new = $ver_new_same ]]; then
|
69
|
+
echo "$ver_new" > VERSION
|
70
|
+
else
|
71
|
+
echo "ERROR: invalid version: $ver_new" 1>&2
|
72
|
+
exit 1
|
73
|
+
fi
|
74
|
+
;;
|
75
|
+
esac
|
76
|
+
|
77
|
+
if [[ -f Gemfile ]]; then
|
78
|
+
bundle check 2>&1 >/dev/null || { bundle --quiet install --local --path vendor/bundle || bundle check > /dev/null; }
|
79
|
+
git add Gemfile.lock
|
80
|
+
fi
|
81
|
+
|
82
|
+
git add VERSION
|
83
|
+
|
84
|
+
ver_bumped=$(cat VERSION)
|
85
|
+
git commit -m "bump: $ver_bumped"
|
86
|
+
git tag "v$ver_bumped"
|
87
|
+
echo $ver_bumped
|
88
|
+
;;
|
89
|
+
|
39
90
|
*)
|
40
91
|
set $(for a in "$@"; do echo $a.app; done)
|
41
92
|
case "$(basename $0)" in
|
42
|
-
deploy
|
93
|
+
deploy)
|
43
94
|
bundle exec cap "$@" deploy
|
44
95
|
;;
|
45
96
|
|
46
|
-
|
47
|
-
bundle exec cap "$@" deploy
|
97
|
+
release)
|
98
|
+
bundle exec cap "$@" deploy
|
48
99
|
;;
|
49
100
|
|
50
101
|
stage)
|
51
102
|
bundle exec cap "$@" deploy:update_code
|
52
103
|
;;
|
53
104
|
|
54
|
-
activate)
|
55
|
-
bundle exec cap "$@" deploy:symlink deploy:restart
|
56
|
-
;;
|
57
|
-
|
58
|
-
compare)
|
59
|
-
bundle exec cap "$@" deploy:compare
|
60
|
-
;;
|
61
|
-
|
62
105
|
restart)
|
63
106
|
bundle exec cap "$@" deploy:restart
|
64
107
|
;;
|
65
108
|
|
66
|
-
|
67
|
-
bundle exec cap "$@" deploy:
|
109
|
+
config)
|
110
|
+
bundle exec cap "$@" deploy:config
|
68
111
|
;;
|
69
112
|
|
70
113
|
build)
|
@@ -75,8 +118,32 @@ case "$(basename $0)" in
|
|
75
118
|
bundle exec cap "$@" deploy:dist
|
76
119
|
;;
|
77
120
|
|
78
|
-
|
79
|
-
bundle exec cap "$@" deploy:
|
121
|
+
activate)
|
122
|
+
bundle exec cap "$@" deploy:symlink deploy:restart
|
123
|
+
;;
|
124
|
+
|
125
|
+
rollback)
|
126
|
+
bundle exec cap "$@" deploy:rollback
|
127
|
+
;;
|
128
|
+
|
129
|
+
check)
|
130
|
+
bundle exec cap "$@" deploy:check
|
131
|
+
;;
|
132
|
+
|
133
|
+
compare)
|
134
|
+
bundle exec cap "$@" deploy:compare
|
135
|
+
;;
|
136
|
+
|
137
|
+
plan)
|
138
|
+
bundle exec cap "$@" deploy:plan
|
139
|
+
;;
|
140
|
+
|
141
|
+
lock)
|
142
|
+
bundle exec cap "$@" deploy:lock
|
143
|
+
;;
|
144
|
+
|
145
|
+
unlock)
|
146
|
+
bundle exec cap "$@" deploy:unlock
|
80
147
|
;;
|
81
148
|
|
82
149
|
invoke)
|
data/libexec/rollback
CHANGED
@@ -36,35 +36,78 @@ case "$(basename $0)" in
|
|
36
36
|
} 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | sed 's#eea914aaa8dde6fdae29242b1084a2b0415eefaf ##'
|
37
37
|
;;
|
38
38
|
|
39
|
+
bump)
|
40
|
+
case "$1" in
|
41
|
+
patch|minor|major)
|
42
|
+
bump=$1; shift
|
43
|
+
set $(cat VERSION | sed 's#\.# #g')
|
44
|
+
case "$bump" in
|
45
|
+
patch)
|
46
|
+
echo "$1.$2.$(($3 + 1))"
|
47
|
+
;;
|
48
|
+
minor)
|
49
|
+
echo "$1.$(($2 + 1)).0"
|
50
|
+
;;
|
51
|
+
major)
|
52
|
+
echo "$(($1 + 1)).0.0"
|
53
|
+
;;
|
54
|
+
esac > VERSION
|
55
|
+
;;
|
56
|
+
*)
|
57
|
+
ver_new=$1; shift
|
58
|
+
set $(echo "$ver_new" | sed 's#\.# #g') 0
|
59
|
+
M=$1; shift
|
60
|
+
m=$1; shift
|
61
|
+
p=$1; shift
|
62
|
+
|
63
|
+
tmp_version=$(mktemp -t XXXXXXXXX)
|
64
|
+
(echo "$(($M+0)).$(($m+0)).$(($p+0))" > $tmp_version) 2>&-
|
65
|
+
ver_new_same=$(cat $tmp_version)
|
66
|
+
rm -f $tmp_version
|
67
|
+
|
68
|
+
if [[ $ver_new = $ver_new_same ]]; then
|
69
|
+
echo "$ver_new" > VERSION
|
70
|
+
else
|
71
|
+
echo "ERROR: invalid version: $ver_new" 1>&2
|
72
|
+
exit 1
|
73
|
+
fi
|
74
|
+
;;
|
75
|
+
esac
|
76
|
+
|
77
|
+
if [[ -f Gemfile ]]; then
|
78
|
+
bundle check 2>&1 >/dev/null || { bundle --quiet install --local --path vendor/bundle || bundle check > /dev/null; }
|
79
|
+
git add Gemfile.lock
|
80
|
+
fi
|
81
|
+
|
82
|
+
git add VERSION
|
83
|
+
|
84
|
+
ver_bumped=$(cat VERSION)
|
85
|
+
git commit -m "bump: $ver_bumped"
|
86
|
+
git tag "v$ver_bumped"
|
87
|
+
echo $ver_bumped
|
88
|
+
;;
|
89
|
+
|
39
90
|
*)
|
40
91
|
set $(for a in "$@"; do echo $a.app; done)
|
41
92
|
case "$(basename $0)" in
|
42
|
-
deploy
|
93
|
+
deploy)
|
43
94
|
bundle exec cap "$@" deploy
|
44
95
|
;;
|
45
96
|
|
46
|
-
|
47
|
-
bundle exec cap "$@" deploy
|
97
|
+
release)
|
98
|
+
bundle exec cap "$@" deploy
|
48
99
|
;;
|
49
100
|
|
50
101
|
stage)
|
51
102
|
bundle exec cap "$@" deploy:update_code
|
52
103
|
;;
|
53
104
|
|
54
|
-
activate)
|
55
|
-
bundle exec cap "$@" deploy:symlink deploy:restart
|
56
|
-
;;
|
57
|
-
|
58
|
-
compare)
|
59
|
-
bundle exec cap "$@" deploy:compare
|
60
|
-
;;
|
61
|
-
|
62
105
|
restart)
|
63
106
|
bundle exec cap "$@" deploy:restart
|
64
107
|
;;
|
65
108
|
|
66
|
-
|
67
|
-
bundle exec cap "$@" deploy:
|
109
|
+
config)
|
110
|
+
bundle exec cap "$@" deploy:config
|
68
111
|
;;
|
69
112
|
|
70
113
|
build)
|
@@ -75,8 +118,32 @@ case "$(basename $0)" in
|
|
75
118
|
bundle exec cap "$@" deploy:dist
|
76
119
|
;;
|
77
120
|
|
78
|
-
|
79
|
-
bundle exec cap "$@" deploy:
|
121
|
+
activate)
|
122
|
+
bundle exec cap "$@" deploy:symlink deploy:restart
|
123
|
+
;;
|
124
|
+
|
125
|
+
rollback)
|
126
|
+
bundle exec cap "$@" deploy:rollback
|
127
|
+
;;
|
128
|
+
|
129
|
+
check)
|
130
|
+
bundle exec cap "$@" deploy:check
|
131
|
+
;;
|
132
|
+
|
133
|
+
compare)
|
134
|
+
bundle exec cap "$@" deploy:compare
|
135
|
+
;;
|
136
|
+
|
137
|
+
plan)
|
138
|
+
bundle exec cap "$@" deploy:plan
|
139
|
+
;;
|
140
|
+
|
141
|
+
lock)
|
142
|
+
bundle exec cap "$@" deploy:lock
|
143
|
+
;;
|
144
|
+
|
145
|
+
unlock)
|
146
|
+
bundle exec cap "$@" deploy:unlock
|
80
147
|
;;
|
81
148
|
|
82
149
|
invoke)
|
data/libexec/shell
CHANGED
@@ -36,35 +36,78 @@ case "$(basename $0)" in
|
|
36
36
|
} 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | sed 's#eea914aaa8dde6fdae29242b1084a2b0415eefaf ##'
|
37
37
|
;;
|
38
38
|
|
39
|
+
bump)
|
40
|
+
case "$1" in
|
41
|
+
patch|minor|major)
|
42
|
+
bump=$1; shift
|
43
|
+
set $(cat VERSION | sed 's#\.# #g')
|
44
|
+
case "$bump" in
|
45
|
+
patch)
|
46
|
+
echo "$1.$2.$(($3 + 1))"
|
47
|
+
;;
|
48
|
+
minor)
|
49
|
+
echo "$1.$(($2 + 1)).0"
|
50
|
+
;;
|
51
|
+
major)
|
52
|
+
echo "$(($1 + 1)).0.0"
|
53
|
+
;;
|
54
|
+
esac > VERSION
|
55
|
+
;;
|
56
|
+
*)
|
57
|
+
ver_new=$1; shift
|
58
|
+
set $(echo "$ver_new" | sed 's#\.# #g') 0
|
59
|
+
M=$1; shift
|
60
|
+
m=$1; shift
|
61
|
+
p=$1; shift
|
62
|
+
|
63
|
+
tmp_version=$(mktemp -t XXXXXXXXX)
|
64
|
+
(echo "$(($M+0)).$(($m+0)).$(($p+0))" > $tmp_version) 2>&-
|
65
|
+
ver_new_same=$(cat $tmp_version)
|
66
|
+
rm -f $tmp_version
|
67
|
+
|
68
|
+
if [[ $ver_new = $ver_new_same ]]; then
|
69
|
+
echo "$ver_new" > VERSION
|
70
|
+
else
|
71
|
+
echo "ERROR: invalid version: $ver_new" 1>&2
|
72
|
+
exit 1
|
73
|
+
fi
|
74
|
+
;;
|
75
|
+
esac
|
76
|
+
|
77
|
+
if [[ -f Gemfile ]]; then
|
78
|
+
bundle check 2>&1 >/dev/null || { bundle --quiet install --local --path vendor/bundle || bundle check > /dev/null; }
|
79
|
+
git add Gemfile.lock
|
80
|
+
fi
|
81
|
+
|
82
|
+
git add VERSION
|
83
|
+
|
84
|
+
ver_bumped=$(cat VERSION)
|
85
|
+
git commit -m "bump: $ver_bumped"
|
86
|
+
git tag "v$ver_bumped"
|
87
|
+
echo $ver_bumped
|
88
|
+
;;
|
89
|
+
|
39
90
|
*)
|
40
91
|
set $(for a in "$@"; do echo $a.app; done)
|
41
92
|
case "$(basename $0)" in
|
42
|
-
deploy
|
93
|
+
deploy)
|
43
94
|
bundle exec cap "$@" deploy
|
44
95
|
;;
|
45
96
|
|
46
|
-
|
47
|
-
bundle exec cap "$@" deploy
|
97
|
+
release)
|
98
|
+
bundle exec cap "$@" deploy
|
48
99
|
;;
|
49
100
|
|
50
101
|
stage)
|
51
102
|
bundle exec cap "$@" deploy:update_code
|
52
103
|
;;
|
53
104
|
|
54
|
-
activate)
|
55
|
-
bundle exec cap "$@" deploy:symlink deploy:restart
|
56
|
-
;;
|
57
|
-
|
58
|
-
compare)
|
59
|
-
bundle exec cap "$@" deploy:compare
|
60
|
-
;;
|
61
|
-
|
62
105
|
restart)
|
63
106
|
bundle exec cap "$@" deploy:restart
|
64
107
|
;;
|
65
108
|
|
66
|
-
|
67
|
-
bundle exec cap "$@" deploy:
|
109
|
+
config)
|
110
|
+
bundle exec cap "$@" deploy:config
|
68
111
|
;;
|
69
112
|
|
70
113
|
build)
|
@@ -75,8 +118,32 @@ case "$(basename $0)" in
|
|
75
118
|
bundle exec cap "$@" deploy:dist
|
76
119
|
;;
|
77
120
|
|
78
|
-
|
79
|
-
bundle exec cap "$@" deploy:
|
121
|
+
activate)
|
122
|
+
bundle exec cap "$@" deploy:symlink deploy:restart
|
123
|
+
;;
|
124
|
+
|
125
|
+
rollback)
|
126
|
+
bundle exec cap "$@" deploy:rollback
|
127
|
+
;;
|
128
|
+
|
129
|
+
check)
|
130
|
+
bundle exec cap "$@" deploy:check
|
131
|
+
;;
|
132
|
+
|
133
|
+
compare)
|
134
|
+
bundle exec cap "$@" deploy:compare
|
135
|
+
;;
|
136
|
+
|
137
|
+
plan)
|
138
|
+
bundle exec cap "$@" deploy:plan
|
139
|
+
;;
|
140
|
+
|
141
|
+
lock)
|
142
|
+
bundle exec cap "$@" deploy:lock
|
143
|
+
;;
|
144
|
+
|
145
|
+
unlock)
|
146
|
+
bundle exec cap "$@" deploy:unlock
|
80
147
|
;;
|
81
148
|
|
82
149
|
invoke)
|