alpha_omega 0.0.175 → 0.0.176

Sign up to get free protection for your applications and to get access to all the features.
data/libexec/unlock CHANGED
@@ -1,137 +1,14 @@
1
1
  #!/bin/bash -e
2
2
 
3
- function bump_version {
4
- ensure_clean_git_status
5
-
6
- local_file=
7
- if [[ -f VERSION || -L VERSION ]]; then
8
- local_file=1
9
- if [[ ! -e VERSION ]]; then
10
- echo "ERROR: cannot write to VERSION file" 1>&2
11
- exit 1
12
- fi
13
- fi
14
-
15
- tmp_version=$(mktemp -t XXXXXXXXX)
16
- if [[ -n $local_file ]]; then
17
- cat VERSION | perl -ne 'm{^\s*v?(\d+)\.(\d+)\.(\d+)\s*$} && printf("%03d.%03d.%03d %d.%d.%d\n",$1,$2,$3,$1,$2,$3)' | sort -r | head -1 | awk '{print $2}' > $tmp_version
18
- else
19
- git tag | perl -ne 'm{^v(\d+)\.(\d+)\.(\d+)$} && printf("%03d.%03d.%03d %d.%d.%d\n",$1,$2,$3,$1,$2,$3)' | sort -r | head -1 | awk '{print $2}' > $tmp_version
20
- fi
21
-
22
- case "$1" in
23
- patch|minor|major)
24
- bump=$1; shift
25
- set -- $(cat $tmp_version | sed 's#\.# #g')
26
- case "$bump" in
27
- patch)
28
- echo "$1.$2.$(($3 + 1))"
29
- ;;
30
- minor)
31
- echo "$1.$(($2 + 1)).0"
32
- ;;
33
- major)
34
- echo "$(($1 + 1)).0.0"
35
- ;;
36
- esac > $tmp_version
37
- ;;
38
- *)
39
- ver_new=$1; shift
40
- ver_new=${ver_new#v}
41
- echo $ver_new > $tmp_version
42
- ;;
43
- esac
44
-
45
- ver_new=$(cat $tmp_version)
46
- set -- $(echo "$ver_new" | sed 's#\.# #g') 0
47
- M=$1; shift
48
- m=$1; shift
49
- p=$1; shift
50
-
51
- (echo "$(($M+0)).$(($m+0)).$(($p+0))" > $tmp_version) 2>&-
52
- ver_new_same=$(cat $tmp_version)
53
-
54
- if [[ $ver_new != $ver_new_same ]]; then
55
- echo "ERROR: invalid version: $ver_new" 1>&2
56
- exit 1
57
- fi
58
-
59
- ver_bumped="v$(cat $tmp_version)"
60
- rm -f $tmp_version
61
- ensure_git_tag_available $ver_bumped
62
-
63
- if [[ -n $local_file ]]; then
64
- echo ${ver_bumped#v} > VERSION
65
- git add VERSION
66
- if [[ -f Gemfile ]]; then
67
- bundle check 2>&1 >/dev/null || { bundle --quiet install --local --path vendor/bundle || bundle check > /dev/null; }
68
- git add Gemfile.lock
69
- fi
70
-
71
- git commit -m "bump: $ver_bumped"
72
- git push
73
- fi
74
-
75
- git_tag "$ver_bumped"
76
- echo $ver_bumped
77
- }
78
-
79
- function ensure_git_tag_available {
80
- version=$1; shift
81
- git fetch --tags
82
- remote_sha=$(git ls-remote origin $version | awk '{print $1}')
83
- if [[ -n $remote_sha ]]; then
84
- echo "ERROR: already a remote tag $version, bump again" 1>&2
85
- exit 1
86
- fi
87
-
88
- local_sha=$(git show-ref $version | awk '{print $1}')
89
- if [[ -n $local_sha ]]; then
90
- echo "ERROR: already a local tag $version" 1>&2
91
- exit 1
92
- fi
93
- }
94
-
95
- function git_tag {
96
- local version=$1; shift
97
-
98
- ensure_git_tag_available "$version"
99
-
100
- git tag $version
101
- git push origin tag $version
102
- remote_sha=$(git ls-remote origin $version | awk '{print $1}')
103
- local_sha=$(git show-ref $version | awk '{print $1}')
104
- if [[ $remote_sha != $local_sha ]]; then
105
- echo "ERROR: remote tag $version does not match local SHA" 1>&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) "$@"
106
9
  exit 1
107
10
  fi
108
- }
109
-
110
- function ensure_clean_git_status {
111
- local lines=$(git status -s -uno | wc -l | awk '{print $1}')
112
- if [[ $lines != "0" ]]; then
113
- echo "ERROR: git status is not clean, cannot tag" 1>&2
114
- git status -s -uno
115
- exit 1
116
- fi
117
- }
118
-
119
- case "$(basename $0)" in
120
- bump)
121
- true
122
- ;;
123
- *)
124
- hst_this=$(hostname -s)
125
- if ! echo "$hst_this" | egrep -q "^(admin|develop)"; then
126
- # unless the .ao_no_proxy file exists
127
- if [[ ! -f ".ao_no_proxy" ]]; then
128
- # ssh into deploy host and run from there
129
- exec bin/proxy $(basename $0) "$@"
130
- exit 1
131
- fi
132
- fi
133
- ;;
134
- esac
11
+ fi
135
12
 
136
13
  export LOCAL_ONLY=true
137
14
 
@@ -186,13 +63,6 @@ case "$(basename $0)" in
186
63
  } 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | sed 's#eea914aaa8dde6fdae29242b1084a2b0415eefaf ##'
187
64
  ;;
188
65
 
189
- bump)
190
- if [[ -z $1 ]]; then
191
- set patch
192
- fi
193
- bump_version "$@"
194
- ;;
195
-
196
66
  *)
197
67
  LOCAL_ONLY=
198
68
  if [[ -n $1 ]]; then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alpha_omega
3
3
  version: !ruby/object:Gem::Version
4
- hash: 321
4
+ hash: 383
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 175
10
- version: 0.0.175
9
+ - 176
10
+ version: 0.0.176
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Nghiem
@@ -16,8 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-08-31 00:00:00 +00:00
20
- default_executable:
19
+ date: 2011-08-31 00:00:00 Z
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
22
  name: grit
@@ -117,44 +116,43 @@ files:
117
116
  - LICENSE
118
117
  - VERSION
119
118
  - README.mkd
120
- - libexec/unlock
121
- - libexec/proxy
122
- - libexec/build
123
- - libexec/restart
124
- - libexec/stage
125
119
  - libexec/activate
126
- - libexec/rollback
127
- - libexec/plan
128
- - libexec/compare
129
- - libexec/shell
130
- - libexec/migrate
131
- - libexec/deploy
132
- - libexec/config
120
+ - libexec/build
133
121
  - libexec/bump
134
- - libexec/dna
135
122
  - libexec/check
123
+ - libexec/compare
124
+ - libexec/config
136
125
  - libexec/debug
137
- - libexec/lock
138
- - libexec/invoke
126
+ - libexec/deploy
127
+ - libexec/dist
128
+ - libexec/dna
139
129
  - libexec/hosts
130
+ - libexec/invoke
131
+ - libexec/lock
132
+ - libexec/migrate
133
+ - libexec/plan
134
+ - libexec/proxy
140
135
  - libexec/release
141
- - libexec/dist
142
- - lib/alpha_omega/utils.rb
143
- - lib/alpha_omega/deploy.rb
144
- - lib/alpha_omega/version.rb
136
+ - libexec/restart
137
+ - libexec/rollback
138
+ - libexec/shell
139
+ - libexec/stage
140
+ - libexec/unlock
141
+ - lib/alpha_omega/deploy/dependencies.rb
145
142
  - lib/alpha_omega/deploy/local_dependency.rb
143
+ - lib/alpha_omega/deploy/remote_dependency.rb
144
+ - lib/alpha_omega/deploy/scm/base.rb
145
+ - lib/alpha_omega/deploy/scm/git.rb
146
+ - lib/alpha_omega/deploy/scm.rb
146
147
  - lib/alpha_omega/deploy/strategy/base.rb
147
148
  - lib/alpha_omega/deploy/strategy/checkout.rb
148
149
  - lib/alpha_omega/deploy/strategy/remote.rb
149
- - lib/alpha_omega/deploy/scm.rb
150
- - lib/alpha_omega/deploy/templates/maintenance.rhtml
151
150
  - lib/alpha_omega/deploy/strategy.rb
152
- - lib/alpha_omega/deploy/scm/base.rb
153
- - lib/alpha_omega/deploy/scm/git.rb
154
- - lib/alpha_omega/deploy/dependencies.rb
155
- - lib/alpha_omega/deploy/remote_dependency.rb
151
+ - lib/alpha_omega/deploy/templates/maintenance.rhtml
152
+ - lib/alpha_omega/deploy.rb
153
+ - lib/alpha_omega/utils.rb
154
+ - lib/alpha_omega/version.rb
156
155
  - bin/alpha_omega
157
- has_rdoc: true
158
156
  homepage: https://github.com/HeSYINUvSBZfxqA/alpha_omega
159
157
  licenses: []
160
158
 
@@ -184,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
182
  requirements: []
185
183
 
186
184
  rubyforge_project:
187
- rubygems_version: 1.5.3
185
+ rubygems_version: 1.8.21
188
186
  signing_key:
189
187
  specification_version: 3
190
188
  summary: alpha_omega capistrano recipes