rdeis 0.0.10 → 0.0.11
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.
- checksums.yaml +4 -4
- data/gemconversion +11 -11
- data/lib/rdeis/deploy.rb +3 -2
- data/lib/rdeis/git.rb +7 -3
- data/lib/rdeis/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95f8ccbbdf536ffbf9e3f06a7bc0be6098a13a4f
|
4
|
+
data.tar.gz: ffda91ae7fabf93ca6738fdea20e728041de5674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebc6893431f3bb3fbceb599561fbeee2ababe30c0f676e9382760f12d3f716e324d94ac07b5aa10cb194655779aef85af497236ea227757466d91e4b1e1ca2a9
|
7
|
+
data.tar.gz: ca1126459a60e4268e96fabd4fafea82727651779ac11853f7ee7ce4b59977523d8297b8dbe36a1b40f55cd3feda55a589a4f898e62a17f3d7b1900e59580a50
|
data/gemconversion
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# encoding: UTF-8
|
3
3
|
file = "./Gemfile"
|
4
|
-
ignore = "
|
4
|
+
ignore = "./.gitignore"
|
5
5
|
ruby_version = `ruby -v | grep "ruby [0-9]\.[0-9]\.[0-9]" -o | sed -E "s#ruby ##"`.strip
|
6
6
|
if File.exists?(file)
|
7
7
|
contents = File.open(file, "r") {|f| f.read }
|
@@ -12,12 +12,10 @@ if File.exists?(file)
|
|
12
12
|
contents = contents + "\nruby \"#{ruby_version}\" " if version_found.nil?
|
13
13
|
# write back to file
|
14
14
|
File.open(file, "w"){ |f| f.write(contents) }
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
File.open(ignore, "w"){|g| g.write(ignoring.gsub("gemconversion", "") + "\ngemconversion" ) }
|
20
|
-
end
|
15
|
+
ignoring = ""
|
16
|
+
puts "adding to ignore file"
|
17
|
+
ignoring = File.open(ignore, "r"){|g| g.read } if File.exists?(ignore)
|
18
|
+
File.open(ignore, "w"){|g| g.write(ignoring.gsub("gemconversion", "") + "gemconversion" ) }
|
21
19
|
# look for ruby version file
|
22
20
|
`echo "#{ruby_version}" > ./.ruby-version` if ! File.exists?(".ruby-version")
|
23
21
|
# run the bundle
|
@@ -26,12 +24,14 @@ if File.exists?(file)
|
|
26
24
|
status = `git status | grep "modified.*Gemfile" | wc -l`.to_i
|
27
25
|
# create the commit
|
28
26
|
commit = 0
|
29
|
-
|
30
|
-
|
27
|
+
`git checkout -b deis_#{Time.now.to_i} && git add .gitignore Gemfile Gemfile.lock .ruby-version`
|
28
|
+
commit = `git commit .gitignore Gemfile Gemfile.lock .ruby-version -m '[rdeis] Automated Gemfile conversion - #{Time.now.to_s}' 2>&1 | grep 'Error' | wc -l`.to_i if install == 1 && status > 0
|
29
|
+
head = `sleep 1 && echo $(git rev-parse HEAD)`
|
30
|
+
|
31
31
|
if status == 0
|
32
|
-
$stdout.puts "Converted and commited already"
|
32
|
+
$stdout.puts "Converted and commited already (#{install}/#{commit})"
|
33
33
|
elsif install == 1 && commit == 0
|
34
|
-
$stdout.puts "Converted and commited"
|
34
|
+
$stdout.puts "Converted and commited (#{install}/#{commit})"
|
35
35
|
else
|
36
36
|
abort("Error: install / commit failed (#{install}/#{commit})")
|
37
37
|
end
|
data/lib/rdeis/deploy.rb
CHANGED
@@ -133,7 +133,7 @@ module DEIS
|
|
133
133
|
output[" init and remote"] = DEIS::Deploy::YES
|
134
134
|
end
|
135
135
|
# checkout to the correct branch from the remote
|
136
|
-
checkout = run ("cd #{@deploy_to} && #{DEIS::Git.checkout_to_ref_cmd(
|
136
|
+
checkout = run ("cd #{@deploy_to} && #{DEIS::Git.checkout_to_ref_cmd(@ref, @branch)}")
|
137
137
|
output[" checkout to #{@ref[0..8]}"] = if checkout then DEIS::Deploy::YES else DEIS::Deploy::NO end
|
138
138
|
print_table output
|
139
139
|
end
|
@@ -164,7 +164,8 @@ module DEIS
|
|
164
164
|
output[" Gem conversion"] = if conversion == 1 then DEIS::Deploy::YES else DEIS::Deploy::NO end
|
165
165
|
# push the branch to deis
|
166
166
|
remote_ref = run("cd #{@deploy_to} && #{DEIS::Git.ref_cmd}")
|
167
|
-
|
167
|
+
remote_branch = run("cd #{@deploy_to} && #{DEIS::Git.branch_cmd}")
|
168
|
+
deis = run("cd #{@deploy_to} && git push deis #{remote_branch} | grep Error | wc -l") if conversion == 1
|
168
169
|
output[" Deis push"] = if deis.to_i == 0 then DEIS::Deploy::YES else DEIS::Deploy::NO end
|
169
170
|
print_table output
|
170
171
|
if conversion != 1
|
data/lib/rdeis/git.rb
CHANGED
@@ -32,15 +32,19 @@ module DEIS
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def self.branch
|
35
|
-
|
35
|
+
`#{DEIS::Git.branch_cmd}`.strip
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.branch_cmd
|
39
|
+
"git rev-parse --abbrev-ref HEAD"
|
36
40
|
end
|
37
41
|
|
38
42
|
def self.init_with_remote_cmd(remote)
|
39
43
|
"git init && git remote add origin #{remote} 2>&1 | grep 'fatal:' -o | wc -l"
|
40
44
|
end
|
41
|
-
|
45
|
+
6
|
42
46
|
def self.checkout_to_ref_cmd(ref, branch)
|
43
|
-
"git fetch origin && git checkout -f #{branch} && git checkout -f #{ref} 2>&1 | grep 'error:' | wc -l"
|
47
|
+
"git fetch origin && git checkout -f origin/#{branch} && git branch -d #{branch} ; git checkout -f #{branch} && git checkout -f #{ref} 2>&1 | grep 'error:' | wc -l"
|
44
48
|
end
|
45
49
|
|
46
50
|
# find env based token
|
data/lib/rdeis/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdeis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Marshall
|
@@ -79,7 +79,7 @@ files:
|
|
79
79
|
- lib/rdeis/version.rb
|
80
80
|
- lib/ssh.rb
|
81
81
|
- rdeis.gemspec
|
82
|
-
homepage: https://github.com/charlesmarshall/deis_deploy/tree/0.0.
|
82
|
+
homepage: https://github.com/charlesmarshall/deis_deploy/tree/0.0.11
|
83
83
|
licenses:
|
84
84
|
- MIT
|
85
85
|
metadata: {}
|