alpha_omega 0.0.141 → 0.0.142

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/libexec/lock CHANGED
@@ -1,14 +1,21 @@
1
1
  #!/bin/bash -e
2
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
3
+ case "$(basename $0)" in
4
+ bump)
5
+ true
6
+ ;;
7
+ *)
8
+ hst_this=$(hostname -s)
9
+ if ! echo "$hst_this" | egrep -q "^(admin|develop)"; then
10
+ # unless the .ao_no_proxy file exists
11
+ if [[ ! -f ".ao_no_proxy" ]]; then
12
+ # ssh into deploy host and run from there
13
+ exec bin/proxy $(basename $0) "$@"
14
+ exit 1
15
+ fi
16
+ fi
17
+ ;;
18
+ esac
12
19
 
13
20
  export LOCAL_ONLY=true
14
21
 
@@ -123,51 +130,47 @@ case "$(basename $0)" in
123
130
  fi
124
131
  case "$(basename $0)" in
125
132
  deploy)
126
- bundle exec cap "$@" deploy
133
+ bundle exec cap "$@" deploy:lock deploy
127
134
  ;;
128
135
 
129
136
  release)
130
- bundle exec cap "$@" deploy
137
+ bundle exec cap "$@" deploy:lock deploy
131
138
  ;;
132
139
 
133
140
  stage)
134
- bundle exec cap "$@" deploy:update_code deploy:symlink_next
141
+ bundle exec cap "$@" deploy:lock deploy:update_code deploy:symlink_next
135
142
  ;;
136
143
 
137
144
  restart)
138
- bundle exec cap "$@" deploy:restart
145
+ bundle exec cap "$@" deploy:lock deploy:restart
139
146
  ;;
140
147
 
141
148
  config)
142
- bundle exec cap "$@" deploy:config
149
+ bundle exec cap "$@" deploy:lock deploy:config
143
150
  ;;
144
151
 
145
152
  build)
146
- bundle exec cap "$@" deploy:build
153
+ bundle exec cap "$@" deploy:lock deploy:build
147
154
  ;;
148
155
 
149
156
  dist)
150
- bundle exec cap "$@" deploy:dist
157
+ bundle exec cap "$@" deploy:lock deploy:dist
151
158
  ;;
152
159
 
153
160
  activate)
154
- bundle exec cap "$@" deploy:symlink deploy:restart
161
+ bundle exec cap "$@" deploy:lock deploy:symlink deploy:restart
155
162
  ;;
156
163
 
157
164
  rollback)
158
- bundle exec cap "$@" deploy:rollback
165
+ bundle exec cap "$@" deploy:lock deploy:rollback
159
166
  ;;
160
167
 
161
168
  check)
162
- bundle exec cap "$@" deploy:check
163
- ;;
164
-
165
- compare)
166
- bundle exec cap "$@" deploy:compare
169
+ bundle exec cap "$@" deploy:lock deploy:check
167
170
  ;;
168
171
 
169
172
  plan)
170
- bundle exec cap "$@" deploy:plan
173
+ bundle exec cap "$@" deploy:lock deploy:plan
171
174
  ;;
172
175
 
173
176
  lock)
@@ -182,6 +185,14 @@ case "$(basename $0)" in
182
185
  bundle exec cap "$@" shell
183
186
  ;;
184
187
 
188
+ compare)
189
+ bundle exec cap "$@" deploy:compare
190
+ ;;
191
+
192
+ migrate)
193
+ bundle exec cap "$@" deploy:migrate
194
+ ;;
195
+
185
196
  *)
186
197
  bundle exec cap "$@"
187
198
  ;;
data/libexec/migrate ADDED
@@ -0,0 +1,203 @@
1
+ #!/bin/bash -e
2
+
3
+ case "$(basename $0)" in
4
+ bump)
5
+ true
6
+ ;;
7
+ *)
8
+ hst_this=$(hostname -s)
9
+ if ! echo "$hst_this" | egrep -q "^(admin|develop)"; then
10
+ # unless the .ao_no_proxy file exists
11
+ if [[ ! -f ".ao_no_proxy" ]]; then
12
+ # ssh into deploy host and run from there
13
+ exec bin/proxy $(basename $0) "$@"
14
+ exit 1
15
+ fi
16
+ fi
17
+ ;;
18
+ esac
19
+
20
+ export LOCAL_ONLY=true
21
+
22
+ default_pod=$(cat /etc/podname 2>&- || true)
23
+
24
+ case "$(basename $0)" in
25
+ invoke)
26
+ export COMMAND="$1"; shift
27
+
28
+ if [[ -n $1 ]]; then
29
+ set $(for a in "$@"; do if [[ $default_pod = $a ]]; then echo "default.app"; else echo $a.app; fi; done)
30
+ fi
31
+
32
+ LOCAL_ONLY=
33
+ tmp_invoke=$(mktemp -t XXXXXXXXX)
34
+ bundle exec cap "$@" invoke 2>&1 | perl -pe 's{.\[\d+m}{}g' | perl -ne 'm{^\s*\*+\s*\[(out|err)\s*::\s*([^]]+)\] ?(.*)} && print "$1 $2 $3\n"' > $tmp_invoke 2>&1
35
+
36
+ cat $tmp_invoke | awk '{print $2}' | sort -u | while read -r nm_host; do
37
+ egrep "^(out|err) $nm_host" $tmp_invoke || true
38
+ echo
39
+ done
40
+ rm -f $tmp_invoke
41
+ ;;
42
+ *)
43
+ if [[ -n $1 ]]; then
44
+ set $(for a in "$@"; do if [[ $default_pod = $a ]]; then echo "default"; else echo $a; fi; done)
45
+ fi
46
+
47
+ case "$(basename $0)" in
48
+ debug)
49
+ if [[ -z $1 ]]; then
50
+ set "world"
51
+ fi
52
+
53
+ if [[ -n $1 ]]; then
54
+ cap $(for a in "$@"; do echo $a.echo; done)
55
+ fi
56
+ ;;
57
+
58
+ hosts)
59
+ {
60
+ if [[ -n $1 ]]; then
61
+ cap $(for a in "$@"; do echo $a.echo; done)
62
+ fi
63
+ } 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | awk '{print $NF}' | sort -u
64
+ ;;
65
+
66
+ dna)
67
+ {
68
+ echo "eea914aaa8dde6fdae29242b1084a2b0415eefaf ---"
69
+ if [[ -n $1 ]]; then
70
+ cap $(for a in "$@"; do echo $a.yaml; done)
71
+ fi
72
+ } 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | sed 's#eea914aaa8dde6fdae29242b1084a2b0415eefaf ##'
73
+ ;;
74
+
75
+ bump)
76
+ case "$1" in
77
+ patch|minor|major)
78
+ bump=$1; shift
79
+ set $(cat VERSION | sed 's#\.# #g')
80
+ case "$bump" in
81
+ patch)
82
+ echo "$1.$2.$(($3 + 1))"
83
+ ;;
84
+ minor)
85
+ echo "$1.$(($2 + 1)).0"
86
+ ;;
87
+ major)
88
+ echo "$(($1 + 1)).0.0"
89
+ ;;
90
+ esac > VERSION
91
+ ;;
92
+ *)
93
+ ver_new=$1; shift
94
+ set $(echo "$ver_new" | sed 's#\.# #g') 0
95
+ M=$1; shift
96
+ m=$1; shift
97
+ p=$1; shift
98
+
99
+ tmp_version=$(mktemp -t XXXXXXXXX)
100
+ (echo "$(($M+0)).$(($m+0)).$(($p+0))" > $tmp_version) 2>&-
101
+ ver_new_same=$(cat $tmp_version)
102
+ rm -f $tmp_version
103
+
104
+ if [[ $ver_new = $ver_new_same ]]; then
105
+ echo "$ver_new" > VERSION
106
+ else
107
+ echo "ERROR: invalid version: $ver_new" 1>&2
108
+ exit 1
109
+ fi
110
+ ;;
111
+ esac
112
+
113
+ if [[ -f Gemfile ]]; then
114
+ bundle check 2>&1 >/dev/null || { bundle --quiet install --local --path vendor/bundle || bundle check > /dev/null; }
115
+ git add Gemfile.lock
116
+ fi
117
+
118
+ git add VERSION
119
+
120
+ ver_bumped=$(cat VERSION)
121
+ git commit -m "bump: $ver_bumped"
122
+ git tag "v$ver_bumped"
123
+ echo $ver_bumped
124
+ ;;
125
+
126
+ *)
127
+ LOCAL_ONLY=
128
+ if [[ -n $1 ]]; then
129
+ set $(for a in "$@"; do echo $a.app; done)
130
+ fi
131
+ case "$(basename $0)" in
132
+ deploy)
133
+ bundle exec cap "$@" deploy:lock deploy
134
+ ;;
135
+
136
+ release)
137
+ bundle exec cap "$@" deploy:lock deploy
138
+ ;;
139
+
140
+ stage)
141
+ bundle exec cap "$@" deploy:lock deploy:update_code deploy:symlink_next
142
+ ;;
143
+
144
+ restart)
145
+ bundle exec cap "$@" deploy:lock deploy:restart
146
+ ;;
147
+
148
+ config)
149
+ bundle exec cap "$@" deploy:lock deploy:config
150
+ ;;
151
+
152
+ build)
153
+ bundle exec cap "$@" deploy:lock deploy:build
154
+ ;;
155
+
156
+ dist)
157
+ bundle exec cap "$@" deploy:lock deploy:dist
158
+ ;;
159
+
160
+ activate)
161
+ bundle exec cap "$@" deploy:lock deploy:symlink deploy:restart
162
+ ;;
163
+
164
+ rollback)
165
+ bundle exec cap "$@" deploy:lock deploy:rollback
166
+ ;;
167
+
168
+ check)
169
+ bundle exec cap "$@" deploy:lock deploy:check
170
+ ;;
171
+
172
+ plan)
173
+ bundle exec cap "$@" deploy:lock deploy:plan
174
+ ;;
175
+
176
+ lock)
177
+ bundle exec cap "$@" deploy:dont_unlock deploy:lock
178
+ ;;
179
+
180
+ unlock)
181
+ bundle exec cap "$@" deploy:unlock
182
+ ;;
183
+
184
+ shell)
185
+ bundle exec cap "$@" shell
186
+ ;;
187
+
188
+ compare)
189
+ bundle exec cap "$@" deploy:compare
190
+ ;;
191
+
192
+ migrate)
193
+ bundle exec cap "$@" deploy:migrate
194
+ ;;
195
+
196
+ *)
197
+ bundle exec cap "$@"
198
+ ;;
199
+ esac
200
+ esac
201
+ ;;
202
+ esac
203
+
data/libexec/plan CHANGED
@@ -1,14 +1,21 @@
1
1
  #!/bin/bash -e
2
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
3
+ case "$(basename $0)" in
4
+ bump)
5
+ true
6
+ ;;
7
+ *)
8
+ hst_this=$(hostname -s)
9
+ if ! echo "$hst_this" | egrep -q "^(admin|develop)"; then
10
+ # unless the .ao_no_proxy file exists
11
+ if [[ ! -f ".ao_no_proxy" ]]; then
12
+ # ssh into deploy host and run from there
13
+ exec bin/proxy $(basename $0) "$@"
14
+ exit 1
15
+ fi
16
+ fi
17
+ ;;
18
+ esac
12
19
 
13
20
  export LOCAL_ONLY=true
14
21
 
@@ -123,51 +130,47 @@ case "$(basename $0)" in
123
130
  fi
124
131
  case "$(basename $0)" in
125
132
  deploy)
126
- bundle exec cap "$@" deploy
133
+ bundle exec cap "$@" deploy:lock deploy
127
134
  ;;
128
135
 
129
136
  release)
130
- bundle exec cap "$@" deploy
137
+ bundle exec cap "$@" deploy:lock deploy
131
138
  ;;
132
139
 
133
140
  stage)
134
- bundle exec cap "$@" deploy:update_code deploy:symlink_next
141
+ bundle exec cap "$@" deploy:lock deploy:update_code deploy:symlink_next
135
142
  ;;
136
143
 
137
144
  restart)
138
- bundle exec cap "$@" deploy:restart
145
+ bundle exec cap "$@" deploy:lock deploy:restart
139
146
  ;;
140
147
 
141
148
  config)
142
- bundle exec cap "$@" deploy:config
149
+ bundle exec cap "$@" deploy:lock deploy:config
143
150
  ;;
144
151
 
145
152
  build)
146
- bundle exec cap "$@" deploy:build
153
+ bundle exec cap "$@" deploy:lock deploy:build
147
154
  ;;
148
155
 
149
156
  dist)
150
- bundle exec cap "$@" deploy:dist
157
+ bundle exec cap "$@" deploy:lock deploy:dist
151
158
  ;;
152
159
 
153
160
  activate)
154
- bundle exec cap "$@" deploy:symlink deploy:restart
161
+ bundle exec cap "$@" deploy:lock deploy:symlink deploy:restart
155
162
  ;;
156
163
 
157
164
  rollback)
158
- bundle exec cap "$@" deploy:rollback
165
+ bundle exec cap "$@" deploy:lock deploy:rollback
159
166
  ;;
160
167
 
161
168
  check)
162
- bundle exec cap "$@" deploy:check
163
- ;;
164
-
165
- compare)
166
- bundle exec cap "$@" deploy:compare
169
+ bundle exec cap "$@" deploy:lock deploy:check
167
170
  ;;
168
171
 
169
172
  plan)
170
- bundle exec cap "$@" deploy:plan
173
+ bundle exec cap "$@" deploy:lock deploy:plan
171
174
  ;;
172
175
 
173
176
  lock)
@@ -182,6 +185,14 @@ case "$(basename $0)" in
182
185
  bundle exec cap "$@" shell
183
186
  ;;
184
187
 
188
+ compare)
189
+ bundle exec cap "$@" deploy:compare
190
+ ;;
191
+
192
+ migrate)
193
+ bundle exec cap "$@" deploy:migrate
194
+ ;;
195
+
185
196
  *)
186
197
  bundle exec cap "$@"
187
198
  ;;
data/libexec/release CHANGED
@@ -1,14 +1,21 @@
1
1
  #!/bin/bash -e
2
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
3
+ case "$(basename $0)" in
4
+ bump)
5
+ true
6
+ ;;
7
+ *)
8
+ hst_this=$(hostname -s)
9
+ if ! echo "$hst_this" | egrep -q "^(admin|develop)"; then
10
+ # unless the .ao_no_proxy file exists
11
+ if [[ ! -f ".ao_no_proxy" ]]; then
12
+ # ssh into deploy host and run from there
13
+ exec bin/proxy $(basename $0) "$@"
14
+ exit 1
15
+ fi
16
+ fi
17
+ ;;
18
+ esac
12
19
 
13
20
  export LOCAL_ONLY=true
14
21
 
@@ -123,51 +130,47 @@ case "$(basename $0)" in
123
130
  fi
124
131
  case "$(basename $0)" in
125
132
  deploy)
126
- bundle exec cap "$@" deploy
133
+ bundle exec cap "$@" deploy:lock deploy
127
134
  ;;
128
135
 
129
136
  release)
130
- bundle exec cap "$@" deploy
137
+ bundle exec cap "$@" deploy:lock deploy
131
138
  ;;
132
139
 
133
140
  stage)
134
- bundle exec cap "$@" deploy:update_code deploy:symlink_next
141
+ bundle exec cap "$@" deploy:lock deploy:update_code deploy:symlink_next
135
142
  ;;
136
143
 
137
144
  restart)
138
- bundle exec cap "$@" deploy:restart
145
+ bundle exec cap "$@" deploy:lock deploy:restart
139
146
  ;;
140
147
 
141
148
  config)
142
- bundle exec cap "$@" deploy:config
149
+ bundle exec cap "$@" deploy:lock deploy:config
143
150
  ;;
144
151
 
145
152
  build)
146
- bundle exec cap "$@" deploy:build
153
+ bundle exec cap "$@" deploy:lock deploy:build
147
154
  ;;
148
155
 
149
156
  dist)
150
- bundle exec cap "$@" deploy:dist
157
+ bundle exec cap "$@" deploy:lock deploy:dist
151
158
  ;;
152
159
 
153
160
  activate)
154
- bundle exec cap "$@" deploy:symlink deploy:restart
161
+ bundle exec cap "$@" deploy:lock deploy:symlink deploy:restart
155
162
  ;;
156
163
 
157
164
  rollback)
158
- bundle exec cap "$@" deploy:rollback
165
+ bundle exec cap "$@" deploy:lock deploy:rollback
159
166
  ;;
160
167
 
161
168
  check)
162
- bundle exec cap "$@" deploy:check
163
- ;;
164
-
165
- compare)
166
- bundle exec cap "$@" deploy:compare
169
+ bundle exec cap "$@" deploy:lock deploy:check
167
170
  ;;
168
171
 
169
172
  plan)
170
- bundle exec cap "$@" deploy:plan
173
+ bundle exec cap "$@" deploy:lock deploy:plan
171
174
  ;;
172
175
 
173
176
  lock)
@@ -182,6 +185,14 @@ case "$(basename $0)" in
182
185
  bundle exec cap "$@" shell
183
186
  ;;
184
187
 
188
+ compare)
189
+ bundle exec cap "$@" deploy:compare
190
+ ;;
191
+
192
+ migrate)
193
+ bundle exec cap "$@" deploy:migrate
194
+ ;;
195
+
185
196
  *)
186
197
  bundle exec cap "$@"
187
198
  ;;
data/libexec/restart CHANGED
@@ -1,14 +1,21 @@
1
1
  #!/bin/bash -e
2
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
3
+ case "$(basename $0)" in
4
+ bump)
5
+ true
6
+ ;;
7
+ *)
8
+ hst_this=$(hostname -s)
9
+ if ! echo "$hst_this" | egrep -q "^(admin|develop)"; then
10
+ # unless the .ao_no_proxy file exists
11
+ if [[ ! -f ".ao_no_proxy" ]]; then
12
+ # ssh into deploy host and run from there
13
+ exec bin/proxy $(basename $0) "$@"
14
+ exit 1
15
+ fi
16
+ fi
17
+ ;;
18
+ esac
12
19
 
13
20
  export LOCAL_ONLY=true
14
21
 
@@ -123,51 +130,47 @@ case "$(basename $0)" in
123
130
  fi
124
131
  case "$(basename $0)" in
125
132
  deploy)
126
- bundle exec cap "$@" deploy
133
+ bundle exec cap "$@" deploy:lock deploy
127
134
  ;;
128
135
 
129
136
  release)
130
- bundle exec cap "$@" deploy
137
+ bundle exec cap "$@" deploy:lock deploy
131
138
  ;;
132
139
 
133
140
  stage)
134
- bundle exec cap "$@" deploy:update_code deploy:symlink_next
141
+ bundle exec cap "$@" deploy:lock deploy:update_code deploy:symlink_next
135
142
  ;;
136
143
 
137
144
  restart)
138
- bundle exec cap "$@" deploy:restart
145
+ bundle exec cap "$@" deploy:lock deploy:restart
139
146
  ;;
140
147
 
141
148
  config)
142
- bundle exec cap "$@" deploy:config
149
+ bundle exec cap "$@" deploy:lock deploy:config
143
150
  ;;
144
151
 
145
152
  build)
146
- bundle exec cap "$@" deploy:build
153
+ bundle exec cap "$@" deploy:lock deploy:build
147
154
  ;;
148
155
 
149
156
  dist)
150
- bundle exec cap "$@" deploy:dist
157
+ bundle exec cap "$@" deploy:lock deploy:dist
151
158
  ;;
152
159
 
153
160
  activate)
154
- bundle exec cap "$@" deploy:symlink deploy:restart
161
+ bundle exec cap "$@" deploy:lock deploy:symlink deploy:restart
155
162
  ;;
156
163
 
157
164
  rollback)
158
- bundle exec cap "$@" deploy:rollback
165
+ bundle exec cap "$@" deploy:lock deploy:rollback
159
166
  ;;
160
167
 
161
168
  check)
162
- bundle exec cap "$@" deploy:check
163
- ;;
164
-
165
- compare)
166
- bundle exec cap "$@" deploy:compare
169
+ bundle exec cap "$@" deploy:lock deploy:check
167
170
  ;;
168
171
 
169
172
  plan)
170
- bundle exec cap "$@" deploy:plan
173
+ bundle exec cap "$@" deploy:lock deploy:plan
171
174
  ;;
172
175
 
173
176
  lock)
@@ -182,6 +185,14 @@ case "$(basename $0)" in
182
185
  bundle exec cap "$@" shell
183
186
  ;;
184
187
 
188
+ compare)
189
+ bundle exec cap "$@" deploy:compare
190
+ ;;
191
+
192
+ migrate)
193
+ bundle exec cap "$@" deploy:migrate
194
+ ;;
195
+
185
196
  *)
186
197
  bundle exec cap "$@"
187
198
  ;;