padma-deployment 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/tasks/deployment.rake +21 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWUxODg3NWZiZjExNjEzMDU4M2MzOTMxMWY5YTM3NTljYTUzNTkyZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTE2YTQyZmJlY2EzM2RlMDc4YzQ5MjZhNThkNGU4YWE0NjUyNTY5OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDc3OWRkNWEzNDE5ZGVjMjEwMDU1NzU0NmZmZDA3MDk0OTBiNjdiYTk3Zjdk
|
10
|
+
Yjg2Njg0Y2YyOWU0OGUyMzAyOWFjMTUyOTFlZmQ5NDM4MzI1YTIyOTU4NWFi
|
11
|
+
OTMzNDc1N2UxMTY1Nzk2MjZmZGFjZDU2YTBkYmEwMDJiNmU1YTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWRhZjcxMTBiZWI4OWZmNDhlMmI3NWMxNWVkYmZjZTQ2MTc0NzY0NmIzMjBk
|
14
|
+
NmJmMjU5MzE4MzliMmE5NmJmMzRiNDA0NDhiYjJkMmM4M2YxMzdmZDQyMGU3
|
15
|
+
YmFlYTQ4YTVhOTNkZDU5NzUyMGVhMWExODMyNTU4NTE0ZWJhZDg=
|
data/lib/tasks/deployment.rake
CHANGED
@@ -1,13 +1,19 @@
|
|
1
|
+
# TODO see rugged gem for a better implementation of ruby commands
|
1
2
|
namespace :deploy do
|
2
3
|
|
3
4
|
desc "deploys to staging server"
|
4
5
|
task :staging do
|
5
|
-
puts "deploying to staging..."
|
6
|
+
puts "====> deploying to staging..."
|
7
|
+
|
6
8
|
`git checkout master`
|
7
9
|
`git pull`
|
8
10
|
`git fetch`
|
9
|
-
|
10
|
-
|
11
|
+
if local_branch_exists?('staging')
|
12
|
+
`git checkout staging`
|
13
|
+
`git rebase master`
|
14
|
+
else
|
15
|
+
`git checkout -b staging`
|
16
|
+
end
|
11
17
|
`git push staging staging:master --force`
|
12
18
|
`git push origin staging:staging --force`
|
13
19
|
`git checkout master`
|
@@ -19,7 +25,12 @@ namespace :deploy do
|
|
19
25
|
`git checkout master`
|
20
26
|
`git pull`
|
21
27
|
`git fetch`
|
22
|
-
|
28
|
+
if local_branch_exists?('production')
|
29
|
+
`git checkout production`
|
30
|
+
`git rebase master`
|
31
|
+
else
|
32
|
+
`git checkout -b production`
|
33
|
+
end
|
23
34
|
`git rebase master`
|
24
35
|
`git push origin production:production`
|
25
36
|
`git checkout master`
|
@@ -27,3 +38,9 @@ namespace :deploy do
|
|
27
38
|
end
|
28
39
|
|
29
40
|
end
|
41
|
+
|
42
|
+
# @return [Boolean]
|
43
|
+
def local_branch_exists?(branch_name)
|
44
|
+
`git show-ref --verify --quiet refs/heads/#{branch_name}`
|
45
|
+
$?.success?
|
46
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padma-deployment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dwayne Macgowan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|