employ 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/employ +0 -2
- data/employ.gemspec +1 -0
- data/lib/employ.rb +3 -0
- data/lib/employ/cli.rb +29 -4
- data/lib/employ/git.rb +4 -2
- data/lib/employ/version.rb +1 -1
- metadata +15 -3
- data/lib/employ/cli/promote.rb +0 -24
- data/lib/employ/cli/rollback.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dc87824621c83b35500def738b1fab0388c7dc5
|
4
|
+
data.tar.gz: 09dfe2abe2f44b5ca2af3131d0c6abfd8514a23d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ac3735f0a50a051101de246eb3cdb59662a3cf417f9dd8cab8a89e59a01c774cabec921951852778109fa89687ff6707d675997b758b7159c1edc7388f5064b
|
7
|
+
data.tar.gz: e34c62bf62fc1299bf002bb5758467f4579ab3c661d29f4e457d0c42528d08f221aaeec0a62351a603b62ac5a306f8a95260799354c4d5ce190d8b43cfe0fd81
|
data/bin/employ
CHANGED
data/employ.gemspec
CHANGED
data/lib/employ.rb
CHANGED
data/lib/employ/cli.rb
CHANGED
@@ -1,10 +1,35 @@
|
|
1
|
-
require 'employ/cli/promote'
|
2
|
-
|
3
1
|
module Employ
|
4
2
|
class CLI < Thor
|
5
|
-
class_option :verbose, type: :boolean
|
3
|
+
class_option :verbose, type: :boolean, aliases: :v
|
4
|
+
|
5
|
+
class_option 'assume-yes', type: :boolean, aliases: %w(y yes),
|
6
|
+
desc: 'Automatic yes to prompts'
|
7
|
+
|
8
|
+
desc 'promote <env>', 'promotes commit to <env>'
|
9
|
+
long_desc "TODO"
|
10
|
+
option :interactive, type: :boolean, aliases: :i
|
11
|
+
def promote(env)
|
12
|
+
unless options['assume-yes'] || yes?('Are you sure?')
|
13
|
+
puts 'Nothing done. Bye!'
|
14
|
+
exit 1
|
15
|
+
end
|
16
|
+
|
17
|
+
if options[:interactive]
|
18
|
+
last_tag = Git.last_tag(env)
|
19
|
+
puts "last tag: #{last_tag}" if options[:verbose]
|
20
|
+
# TODO
|
21
|
+
else
|
22
|
+
name = Git.tag!(env)
|
23
|
+
puts "New tag promoted: #{name}" if options[:verbose]
|
24
|
+
end
|
25
|
+
end
|
6
26
|
|
7
|
-
|
27
|
+
desc 'rollback <env>', 'rollbacks <env> tag to the penultimate one'
|
28
|
+
long_desc "TODO"
|
29
|
+
def rollback(env)
|
30
|
+
penultimate_tag = Git.penultimate_tag(env)
|
31
|
+
Git.retag! env, penultimate_tag
|
32
|
+
end
|
8
33
|
|
9
34
|
end
|
10
35
|
end
|
data/lib/employ/git.rb
CHANGED
@@ -3,8 +3,10 @@ module Employ
|
|
3
3
|
extend self
|
4
4
|
|
5
5
|
def tag!(env, tag = nil)
|
6
|
-
name = "#{env}-#{Time.now.
|
7
|
-
`git tag #{name} #{tag}
|
6
|
+
name = "#{env}-#{Time.now.strftime('%Y%m%dT%H%M%S')}"
|
7
|
+
`git tag #{name} #{tag}`
|
8
|
+
`git push --tags`
|
9
|
+
name
|
8
10
|
end
|
9
11
|
|
10
12
|
def retag!(env, tag)
|
data/lib/employ/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: employ
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Rodrigues
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: Github development workflow
|
84
98
|
email:
|
85
99
|
- victorc.rodrigues@gmail.com
|
@@ -98,8 +112,6 @@ files:
|
|
98
112
|
- lib/employ.rb
|
99
113
|
- lib/employ/change.rb
|
100
114
|
- lib/employ/cli.rb
|
101
|
-
- lib/employ/cli/promote.rb
|
102
|
-
- lib/employ/cli/rollback.rb
|
103
115
|
- lib/employ/git.rb
|
104
116
|
- lib/employ/version.rb
|
105
117
|
homepage: http://github.com/rodrigues/employ
|
data/lib/employ/cli/promote.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module Employ
|
2
|
-
class CLI < Thor
|
3
|
-
module Promote
|
4
|
-
|
5
|
-
desc 'promote <env>', 'promotes commit to <env>'
|
6
|
-
|
7
|
-
long_desc <<-DESC
|
8
|
-
|
9
|
-
DESC
|
10
|
-
|
11
|
-
option :interactive, type: :boolean, aliases: :i
|
12
|
-
|
13
|
-
def promote(env)
|
14
|
-
if options[:interactive]
|
15
|
-
last_tag = Git.last_tag(env)
|
16
|
-
|
17
|
-
else
|
18
|
-
Git.tag! env
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/lib/employ/cli/rollback.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
module Employ
|
2
|
-
class CLI < Thor
|
3
|
-
module Rollback
|
4
|
-
|
5
|
-
desc 'rollback <env>', 'rollbacks <env> tag to the penultimate one'
|
6
|
-
|
7
|
-
long_desc <<-DESC
|
8
|
-
|
9
|
-
DESC
|
10
|
-
|
11
|
-
def rollback(env)
|
12
|
-
penultimate_tag = Git.penultimate_tag(env)
|
13
|
-
Git.retag! env, penultimate_tag
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|