geordi 0.10.0 → 0.11.0
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.md +12 -2
- data/bin/deploy-to-production +56 -0
- data/lib/geordi/version.rb +1 -1
- metadata +7 -5
data/README.md
CHANGED
@@ -62,6 +62,16 @@ Removes unnecessary files from your project directory:
|
|
62
62
|
More information at http://makandracards.com/makandra/951-shell-script-to-clean-up-a-project-directory
|
63
63
|
|
64
64
|
|
65
|
+
deploy-to-production
|
66
|
+
-------------------
|
67
|
+
|
68
|
+
Shows the commits between your `master` and `production` branch, then merges the changes and deploys to the production Capistrano stage:
|
69
|
+
|
70
|
+
deploy-to-production
|
71
|
+
|
72
|
+
More information at https://makandracards.com/makandra/7971-shell-script-to-deploy-changes-to-production-and-not-shoot-yourself-in-the-foot
|
73
|
+
|
74
|
+
|
65
75
|
dump-for
|
66
76
|
--------
|
67
77
|
|
@@ -139,9 +149,9 @@ More information at http://makandracards.com/makandra/737-run-a-rake-task-in-all
|
|
139
149
|
remotify-local-branch
|
140
150
|
---------------------
|
141
151
|
|
142
|
-
Pushes the given branch to the remote `origin` and tracks it:
|
152
|
+
Pushes the given branch (or current branch if no argument given) to the remote `origin` and tracks it:
|
143
153
|
|
144
|
-
remotify-local-branch
|
154
|
+
remotify-local-branch <optional-branch-name>
|
145
155
|
|
146
156
|
More information at http://makandracards.com/makandra/520-create-a-remote-branch-in-git
|
147
157
|
|
@@ -0,0 +1,56 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
def header(text)
|
4
|
+
puts colorize(text, 44), ''
|
5
|
+
end
|
6
|
+
|
7
|
+
def colorize(text, color_code)
|
8
|
+
"\e[#{color_code}m#{text}\e[0m"
|
9
|
+
end
|
10
|
+
|
11
|
+
def gray(text)
|
12
|
+
colorize(text, 35)
|
13
|
+
end
|
14
|
+
|
15
|
+
def call_or_fail(command)
|
16
|
+
puts gray(command), ''
|
17
|
+
result = system(command) or raise "Error while calling #{command}: #{$?}"
|
18
|
+
puts
|
19
|
+
result
|
20
|
+
end
|
21
|
+
|
22
|
+
def prompt(message, default)
|
23
|
+
print "#{message}"
|
24
|
+
print " [#{default}]" if default
|
25
|
+
print ": "
|
26
|
+
input = gets.strip
|
27
|
+
if input.empty? && default
|
28
|
+
input = default
|
29
|
+
end
|
30
|
+
puts
|
31
|
+
input
|
32
|
+
end
|
33
|
+
|
34
|
+
puts
|
35
|
+
|
36
|
+
master_branch = prompt('master branch', 'master')
|
37
|
+
production_branch = prompt('production branch', 'production')
|
38
|
+
production_stage = prompt('production capistrano stage', 'production')
|
39
|
+
|
40
|
+
header("Checking what's on #{production_stage} right now...")
|
41
|
+
|
42
|
+
call_or_fail("git checkout #{production_branch} && git pull")
|
43
|
+
|
44
|
+
header("You are about to deploy the following commits from #{master_branch} to #{production_branch}:")
|
45
|
+
|
46
|
+
ENV['PAGER'] = 'cat'
|
47
|
+
|
48
|
+
call_or_fail("git log #{production_branch}..#{master_branch}")
|
49
|
+
|
50
|
+
if prompt("Go ahead with the deployment? (y/n)", "n") == 'y'
|
51
|
+
puts("git merge #{master_branch} && git push && cap #{production_stage} deploy:migrations")
|
52
|
+
call_or_fail("git merge #{master_branch} && git push && cap #{production_stage} deploy:migrations")
|
53
|
+
puts 'Deployment complete.', ''
|
54
|
+
else
|
55
|
+
puts 'Deployment cancelled.', ''
|
56
|
+
end
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geordi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 51
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 11
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.11.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|
@@ -28,6 +28,7 @@ executables:
|
|
28
28
|
- cleanup-directory
|
29
29
|
- console-for
|
30
30
|
- cuc
|
31
|
+
- deploy-to-production
|
31
32
|
- dump-for
|
32
33
|
- dumple
|
33
34
|
- gitpt
|
@@ -56,6 +57,7 @@ files:
|
|
56
57
|
- bin/cleanup-directory
|
57
58
|
- bin/console-for
|
58
59
|
- bin/cuc
|
60
|
+
- bin/deploy-to-production
|
59
61
|
- bin/dump-for
|
60
62
|
- bin/dumple
|
61
63
|
- bin/gitpt
|
@@ -106,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
108
|
requirements: []
|
107
109
|
|
108
110
|
rubyforge_project: geordi
|
109
|
-
rubygems_version: 1.3.
|
111
|
+
rubygems_version: 1.3.7
|
110
112
|
signing_key:
|
111
113
|
specification_version: 3
|
112
114
|
summary: Collection of command line tools we use in our daily work with Ruby, Rails and Linux at makandra.
|