alpha_omega 1.0.1 → 1.1.1

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/bump CHANGED
@@ -1,199 +1,32 @@
1
- #!/bin/bash -e
1
+ #!/bin/bash
2
2
 
3
- export LOCAL_ONLY=
3
+ #/ NAME
4
+ #/ bump -- increments a semver in a file or in git tags
5
+ #/
6
+ #/ SYNOPSIS
7
+ #/ bump [major|minor|patch]
8
+ #/ bump 1.2.3
9
+ #/ bump
10
+ #/ without arguments is equivalent to 'bump patch'
4
11
 
5
- case "$(basename $0)" in
6
- invoke)
7
- export COMMAND="$1"; shift
12
+ # figure out the project root under which bin, lib live
13
+ shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
8
14
 
9
- if [[ -n $1 ]]; then
10
- set -- $(for a in "$@"; do echo $a.app; done)
11
- fi
15
+ # load a jason bourne library
16
+ source "$shome/bin/_treadstone"
12
17
 
13
- tmp_invoke=$(mktemp -t XXXXXXXXX)
14
- 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
18
+ # parse the command-line
19
+ DEFINE_boolean 'dirty' "$FLAGS_FALSE" 'force bumping in unclean work area' 'f'
15
20
 
16
- cat $tmp_invoke | awk '{print $2}' | sort -u | while read -r nm_host; do
17
- egrep "^(out|err) $nm_host" $tmp_invoke || true
18
- echo
19
- done
20
- rm -f $tmp_invoke
21
- ;;
22
- *)
23
- if [[ -n $1 ]]; then
24
- set -- $(for a in "$@"; do echo $a; done)
25
- fi
21
+ # entry point
22
+ function main {
23
+ require 'bump'
26
24
 
27
- case "$(basename $0)" in
28
- debug)
29
- LOCAL_ONLY=true
30
- if [[ -z $1 ]]; then
31
- set "world"
32
- fi
25
+ if [[ "$#" = 0 ]]; then
26
+ set -- patch
27
+ fi
33
28
 
34
- if [[ -n $1 ]]; then
35
- cap $(for a in "$@"; do echo $a.echo; done)
36
- fi
37
- ;;
38
-
39
- hosts)
40
- LOCAL_ONLY=true
41
- {
42
- if [[ -n $1 ]]; then
43
- cap $(for a in "$@"; do echo $a.echo; done)
44
- fi
45
- } 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | awk '{print $NF}' | sort -u
46
- ;;
47
-
48
- dna)
49
- LOCAL_ONLY=true
50
- {
51
- echo "eea914aaa8dde6fdae29242b1084a2b0415eefaf ---"
52
- if [[ -n $1 ]]; then
53
- cap $(for a in "$@"; do echo $a.yaml; done)
54
- fi
55
- } 2>&1 | grep eea914aaa8dde6fdae29242b1084a2b0415eefaf | sed 's#eea914aaa8dde6fdae29242b1084a2b0415eefaf ##'
56
- ;;
57
-
58
- task)
59
- if [[ -n $1 ]]; then
60
- nm_task=$1; shift
61
- set -- $(for a in "$@"; do echo $a.app; done)
62
- fi
63
- bundle exec cap "$@" deploy:lock_migrate deploy:migrate "$nm_task"
64
- ;;
65
-
66
- *)
67
- if [[ -n $1 ]]; then
68
- set -- $(for a in "$@"; do echo $a.app; done)
69
- fi
70
- case "$(basename $0)" in
71
- deploy)
72
- bundle exec cap "$@" deploy:lock deploy
73
- ;;
74
-
75
- release)
76
- bundle exec cap "$@" deploy:lock deploy
77
- ;;
78
-
79
- stage)
80
- bundle exec cap "$@" deploy:lock deploy:update_code deploy:symlink_next
81
- ;;
82
-
83
- restart)
84
- bundle exec cap "$@" deploy:lock deploy:restart
85
- ;;
86
-
87
- config)
88
- bundle exec cap "$@" deploy:lock deploy:config
89
- ;;
90
-
91
- build)
92
- bundle exec cap "$@" deploy:lock deploy:build
93
- ;;
94
-
95
- dist)
96
- bundle exec cap "$@" deploy:lock deploy:dist
97
- ;;
98
-
99
- activate)
100
- bundle exec cap "$@" deploy:lock deploy:symlink deploy:restart
101
- ;;
102
-
103
- rollback)
104
- bundle exec cap "$@" deploy:lock deploy:rollback
105
- ;;
106
-
107
- check)
108
- bundle exec cap "$@" deploy:lock deploy:check
109
- ;;
110
-
111
- plan)
112
- bundle exec cap "$@" deploy:lock deploy:plan
113
- ;;
114
-
115
- lock)
116
- case "${1%.app}" in
117
- compare|migrate)
118
- nm_lock="${1%.app}"; shift
119
- bundle exec cap "$@" deploy:dont_unlock "deploy:lock_${nm_lock}"
120
- ;;
121
- *)
122
- bundle exec cap "$@" deploy:dont_unlock deploy:lock
123
- ;;
124
- esac
125
- ;;
126
-
127
- unlock)
128
- case "${1%.app}" in
129
- compare|migrate)
130
- nm_lock="${1%.app}"; shift
131
- bundle exec cap "$@" "deploy:unlock_${nm_lock}"
132
- ;;
133
- *)
134
- bundle exec cap "$@" deploy:unlock
135
- ;;
136
- esac
137
- ;;
138
-
139
- shell)
140
- bundle exec cap "$@" shell
141
- ;;
142
-
143
- compare)
144
- bundle exec cap "$@" deploy:lock_compare deploy:compare
145
- ;;
146
-
147
- repl)
148
- bundle exec cap "$@" deploy:lock_compare deploy:repl
149
- ;;
150
-
151
- migrate)
152
- want_list=
153
- if [[ "${1%.app}" = "list" ]]; then
154
- want_list=1; shift
155
- fi
156
-
157
- change_group=
158
- migration=
159
- case "${1%.app}" in
160
- data)
161
- change_group=${1%.app}; shift
162
- ;;
163
- pre)
164
- change_group=${1%.app}; shift
165
- ;;
166
- during)
167
- change_group=${1%.app} shift
168
- ;;
169
- post)
170
- change_group=${1%.app}; shift
171
- ;;
172
- [0123456789][0123456789][0123456789][0123456789][0123456789][0123456789][0123456789][0123456789][0123456789][0123456789][0123456789][0123456789][0123456789][0123456789])
173
- migration=${1%.app}; shift
174
- ;;
175
- esac
176
-
177
- if [[ -n $change_group ]]; then
178
- if [[ -n $want_list ]]; then
179
- echo "listing change group $change_group"
180
- else
181
- echo "running change group $change_group"
182
- fi
183
- elif [[ -n $migration ]]; then
184
- echo "running migration $migratio"
185
- elif [[ -n $want_list ]]; then
186
- echo "listing migrations"
187
- fi
188
-
189
- bundle exec cap "$@" deploy:lock_migrate deploy:migrate
190
- ;;
191
-
192
- *)
193
- bundle exec cap "$@"
194
- ;;
195
- esac
196
- esac
197
- ;;
198
- esac
29
+ bump_version "$FLAGS_dirty" "$@"
30
+ }
199
31
 
32
+ require sub "$BASH_SOURCE" "$@"
data/libexec/bump.orig ADDED
@@ -0,0 +1,32 @@
1
+ #!/bin/bash
2
+
3
+ #/ NAME
4
+ #/ bump -- increments a semver in a file or in git tags
5
+ #/
6
+ #/ SYNOPSIS
7
+ #/ bump [major|minor|patch]
8
+ #/ bump 1.2.3
9
+ #/ bump
10
+ #/ without arguments is equivalent to 'bump patch'
11
+
12
+ # figure out the project root under which bin, lib live
13
+ shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
14
+
15
+ # load a jason bourne library
16
+ source "$shome/bin/_treadstone"
17
+
18
+ # parse the command-line
19
+ DEFINE_boolean 'dirty' "$FLAGS_FALSE" 'force bumping in unclean work area' 'f'
20
+
21
+ # entry point
22
+ function main {
23
+ require 'bump'
24
+
25
+ if [[ "$#" = 0 ]]; then
26
+ set -- patch
27
+ fi
28
+
29
+ bump_version "$FLAGS_dirty" "$@"
30
+ }
31
+
32
+ require sub "$BASH_SOURCE" "$@"
data/libexec/edit-gem ADDED
@@ -0,0 +1,81 @@
1
+ #!/bin/bash
2
+
3
+ #/ NAME
4
+ #/ edit-gem -- set environment to hint to Gemfile to use a local gemspec
5
+ #/
6
+ #/ SYNOPSIS
7
+ #/ edit gem <name> [location]
8
+ #/ edit gem -r <names>
9
+ #/ edit gem -R
10
+
11
+ # figure out the project root under which bin, lib live
12
+ shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
13
+
14
+ # load a jason bourne library
15
+ source "$shome/bin/_treadstone"
16
+
17
+ # define command line options:
18
+ DEFINE_boolean "update" "$FLAGS_FALSE" "finish editing a local gem and updates project" "u"
19
+ DEFINE_boolean "reset" "$FLAGS_FALSE" "reset gem to remote" "r"
20
+ DEFINE_boolean "resetall" "$FLAGS_FALSE" "reset all gems to remote" "R"
21
+
22
+ # entry point
23
+ function main {
24
+ if [[ "$FLAGS_resetall" = "$FLAGS_TRUE" ]]; then
25
+ set +f
26
+ rm -f $shome/.local/*
27
+ set -f
28
+ bundle --local --quiet && bundle check > /dev/null
29
+ git diff --no-ext-diff Gemfile.lock vendor/cache
30
+ elif [[ "$FLAGS_reset" = "$FLAGS_TRUE" ]]; then
31
+ local nm_gem
32
+ for nm_gem in "$@"; do
33
+ rm -f "$shome/.local/$nm_gem"
34
+ done
35
+
36
+ bundle --local --quiet && bundle check > /dev/null
37
+
38
+ git diff --no-ext-diff Gemfile.lock vendor/cache
39
+ elif [[ "$FLAGS_update" = "$FLAGS_TRUE" ]]; then
40
+ local nm_gem
41
+ for nm_gem in "$@"; do
42
+ echo -n > "$shome/.local/$nm_gem"
43
+ done
44
+
45
+ bundle update "$@"
46
+
47
+ for nm_gem in "$@"; do
48
+ rm -f "$shome/.local/$nm_gem"
49
+ done
50
+ bundle --local --quiet && bundle check > /dev/null
51
+
52
+ git add Gemfile.lock vendor/cache
53
+ git add -u vendor/cache
54
+ git diff --no-ext-diff --cached Gemfile.lock vendor/cache
55
+ else
56
+ local nm_gem="$1"; shift
57
+
58
+ local pth_gem
59
+ if [[ "$#" = 0 ]]; then
60
+ pth_gem="gems/$nm_gem"
61
+ else
62
+ pth_gem="$1"; shift
63
+ fi
64
+
65
+ if [[ ! -d "$pth_gem" ]]; then
66
+ logger_fatal "cannot find local gem directoy at $pth_gem"
67
+ exit 1
68
+ fi
69
+
70
+ pth_gem="$(cd -P -- "$pth_gem" && pwd -P)"
71
+
72
+ echo "enabling local gem development on ${nm_gem} at ${pth_gem}"
73
+ mkdir -p "$shome/.local"
74
+ echo "$pth_gem" > "$shome/.local/$nm_gem"
75
+
76
+ bundle --local --quiet && bundle check > /dev/null
77
+ git diff --no-ext-diff Gemfile.lock vendor/cache
78
+ fi
79
+ }
80
+
81
+ require sub "$BASH_SOURCE" "$@"
data/libexec/publish ADDED
@@ -0,0 +1,58 @@
1
+ #!/bin/bash
2
+
3
+ #/ NAME
4
+ #/ publish-gem -- publish a gem to a local, remote rubygems, geminabox repository
5
+ #/
6
+ #/ SYNOPSIS
7
+ #/ publish gem [--public | --private | --local]
8
+
9
+ # figure out the project root under which bin, lib live
10
+ shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
+
12
+ # load a jason bourne library
13
+ source "$shome/bin/_treadstone"
14
+
15
+ # define command line options:
16
+ DEFINE_boolean "private" "$FLAGS_TRUE" "push to a local, private geminabox"
17
+ DEFINE_boolean "shared" "$FLAGS_FALSE" "push to a shared, private geminabox"
18
+ DEFINE_boolean "public" "$FLAGS_FALSE" "push to rubygems.org"
19
+
20
+ # entry point
21
+ function main {
22
+ if [[ "$FLAGS_public" = "$FLAGS_TRUE" ]]; then
23
+ push_gem "$@"
24
+ elif [[ "$FLAGS_private" = "$FLAGS_TRUE" ]]; then
25
+ push_gem_private
26
+ else
27
+ logger_fatal "must specify --public to confirm a gem push to rubygems.org"
28
+ exit 1
29
+ fi
30
+ }
31
+
32
+ # push a gem locally
33
+ function push_gem_private {
34
+ if [[ "$#" = 0 ]]; then
35
+ set +f
36
+ local latest_gem="$(ls -td *.gem 2>&- | head -1)"
37
+ push_gem_private "$latest_gem"
38
+ set -f
39
+ else
40
+ gem inabox -g http://localhost:9292 "$@"
41
+ fi
42
+ }
43
+
44
+ # push the latest gem to rubygems.org
45
+ function push_gem {
46
+ set +f
47
+ local latest_gem="$(ls -td *.gem 2>&- | head -1)"
48
+ set -f
49
+
50
+ if [[ -z "$latest_gem" ]]; then
51
+ logger_fatal "no gems found"
52
+ exit 1
53
+ fi
54
+
55
+ gem push "$latest_gem"
56
+ }
57
+
58
+ require sub "$BASH_SOURCE" "$@"
@@ -0,0 +1,58 @@
1
+ #!/bin/bash
2
+
3
+ #/ NAME
4
+ #/ publish-gem -- publish a gem to a local, remote rubygems, geminabox repository
5
+ #/
6
+ #/ SYNOPSIS
7
+ #/ publish gem [--public | --private | --local]
8
+
9
+ # figure out the project root under which bin, lib live
10
+ shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
+
12
+ # load a jason bourne library
13
+ source "$shome/bin/_treadstone"
14
+
15
+ # define command line options:
16
+ DEFINE_boolean "private" "$FLAGS_TRUE" "push to a local, private geminabox"
17
+ DEFINE_boolean "shared" "$FLAGS_FALSE" "push to a shared, private geminabox"
18
+ DEFINE_boolean "public" "$FLAGS_FALSE" "push to rubygems.org"
19
+
20
+ # entry point
21
+ function main {
22
+ if [[ "$FLAGS_public" = "$FLAGS_TRUE" ]]; then
23
+ push_gem "$@"
24
+ elif [[ "$FLAGS_private" = "$FLAGS_TRUE" ]]; then
25
+ push_gem_private
26
+ else
27
+ logger_fatal "must specify --public to confirm a gem push to rubygems.org"
28
+ exit 1
29
+ fi
30
+ }
31
+
32
+ # push a gem locally
33
+ function push_gem_private {
34
+ if [[ "$#" = 0 ]]; then
35
+ set +f
36
+ local latest_gem="$(ls -td *.gem 2>&- | head -1)"
37
+ push_gem_private "$latest_gem"
38
+ set -f
39
+ else
40
+ gem inabox -g http://localhost:9292 "$@"
41
+ fi
42
+ }
43
+
44
+ # push the latest gem to rubygems.org
45
+ function push_gem {
46
+ set +f
47
+ local latest_gem="$(ls -td *.gem 2>&- | head -1)"
48
+ set -f
49
+
50
+ if [[ -z "$latest_gem" ]]; then
51
+ logger_fatal "no gems found"
52
+ exit 1
53
+ fi
54
+
55
+ gem push "$latest_gem"
56
+ }
57
+
58
+ require sub "$BASH_SOURCE" "$@"
@@ -0,0 +1,37 @@
1
+ #!/bin/bash
2
+
3
+ #/ NAME
4
+ #/ stub-prepare -- prepares a new stub
5
+ #/
6
+ #/ SYNOPSIS
7
+ #/ stub prepare <new_command>
8
+
9
+ # figure out the project root under which bin, lib live
10
+ shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
+
12
+ # load a jason bourne library
13
+ source "$shome/bin/_treadstone"
14
+
15
+ # parse the command-line
16
+
17
+ # entry point
18
+ function main {
19
+ if [[ "$#" = 0 ]]; then
20
+ logger_fatal "missing new command name"
21
+ exit 1
22
+ fi
23
+
24
+ local dollar='$'
25
+ local nm_command="$1"; shift
26
+
27
+ ln -vs stub "$shome/bin/$nm_command"
28
+ cat > "$shome/libexec/$nm_command" << EOF
29
+ echo arguments are ${dollar}@"
30
+ EOF
31
+ chmod 755 "$shome/libexec/$nm_command"
32
+
33
+ logger_info "$nm_command is stubbed at bin/$nm_command"
34
+ logger_info "edit libexec/$nm_command for the actual script"
35
+ }
36
+
37
+ require 'sub' "$BASH_SOURCE" "$@"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alpha_omega
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -138,7 +138,10 @@ files:
138
138
  - README.mkd
139
139
  - libexec/activate
140
140
  - libexec/build
141
+ - libexec/build-gem
142
+ - libexec/build.orig
141
143
  - libexec/bump
144
+ - libexec/bump.orig
142
145
  - libexec/check
143
146
  - libexec/compare
144
147
  - libexec/config
@@ -146,21 +149,21 @@ files:
146
149
  - libexec/deploy
147
150
  - libexec/dist
148
151
  - libexec/dna
152
+ - libexec/edit-gem
149
153
  - libexec/hosts
150
154
  - libexec/invoke
151
155
  - libexec/lock
152
156
  - libexec/migrate
153
157
  - libexec/plan
154
- - libexec/pygmentize
158
+ - libexec/publish
159
+ - libexec/publish-gem
155
160
  - libexec/release
156
161
  - libexec/repl
157
162
  - libexec/restart
158
- - libexec/rocco
159
163
  - libexec/rollback
160
164
  - libexec/shell
161
- - libexec/shocco
162
- - libexec/shocco.sh
163
165
  - libexec/stage
166
+ - libexec/stub-prepare
164
167
  - libexec/task
165
168
  - libexec/unlock
166
169
  - lib/alpha_omega/deploy/dependencies.rb
data/libexec/pygmentize DELETED
@@ -1,32 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/ NAME
4
- #/ pygmentize -- wrapper to call pygmentize under virtualenv
5
- #/
6
- #/ SYNOPSIS
7
- #/ pygmentize ...
8
-
9
- # figure out the project root under which bin, lib live
10
- shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
-
12
- # load a jason bourne library
13
- source "$shome/bin/_treadstone"
14
-
15
- # entry point
16
- function main {
17
- export BUNDLE_GEMFILE="$shome/.doc/Gemfile"
18
- export shome
19
-
20
- ( cd $shome/.doc && bundle check 2>&1 >/dev/null || { bundle install --quiet --local --path vendor/bundle || bundle check > /dev/null; } )
21
- exec bundle exec $shome/bin/venv pygmentize "$@"
22
- }
23
-
24
- # define command line options:
25
- # var name, default, description, short option
26
-
27
- # parse the command-line
28
- #parse_command_line "$@" || exit $?
29
- #eval set -- "${FLAGS_ARGV}"
30
-
31
- # pass arguments to entry point
32
- main "$@"
data/libexec/rocco DELETED
@@ -1,32 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/ NAME
4
- #/ rocco -- wrapper to call rocco under virtualenv
5
- #/
6
- #/ SYNOPSIS
7
- #/ rocco ...
8
-
9
- # figure out the project root under which bin, lib live
10
- shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
-
12
- # load a jason bourne library
13
- source "$shome/bin/_treadstone"
14
-
15
- # entry point
16
- function main {
17
- export BUNDLE_GEMFILE="$shome/.doc/Gemfile"
18
- export shome
19
-
20
- ( cd $shome/.doc && bundle check 2>&1 >/dev/null || { bundle install --quiet --local --path vendor/bundle || bundle check > /dev/null; } )
21
- exec bundle exec $shome/bin/venv rocco "$@"
22
- }
23
-
24
- # define command line options:
25
- # var name, default, description, short option
26
-
27
- # parse the command-line
28
- #parse_command_line "$@" || exit $?
29
- #eval set -- "${FLAGS_ARGV}"
30
-
31
- # pass arguments to entry point
32
- main "$@"
data/libexec/shocco DELETED
@@ -1,32 +0,0 @@
1
- #!/bin/bash
2
-
3
- #/ NAME
4
- #/ shocco -- wrapper to call shocco under virtualenv
5
- #/
6
- #/ SYNOPSIS
7
- #/ shocco ...
8
-
9
- # figure out the project root under which bin, lib live
10
- shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)"
11
-
12
- # load a jason bourne library
13
- source "$shome/bin/_treadstone"
14
-
15
- # entry point
16
- function main {
17
- export BUNDLE_GEMFILE="$shome/.doc/Gemfile"
18
- export shome
19
-
20
- ( cd $shome/.doc && bundle check 2>&1 >/dev/null || { bundle install --quiet --local --path vendor/bundle || bundle check > /dev/null; } )
21
- exec bundle exec $shome/bin/venv "$shome/libexec/shocco.sh" "$@"
22
- }
23
-
24
- # define command line options:
25
- # var name, default, description, short option
26
-
27
- # parse the command-line
28
- #parse_command_line "$@" || exit $?
29
- #eval set -- "${FLAGS_ARGV}"
30
-
31
- # pass arguments to entry point
32
- main "$@"