padma-deployment 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/tasks/deployment.rake +25 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmZiOGJmOTc1YTIyMTgwOWI0MGUxNjQyN2JjZWI1YWY2MDhmYzFkZQ==
4
+ NDE1ZTBiOTM5ZjJlMzhjNTZmYWFjNjkwZDU2OWIwODZkNTU0YmE2NA==
5
5
  data.tar.gz: !binary |-
6
- NDkzN2QzZDFmZmU2YjZjNDk5NGFiNDdiNzUxYTI3ZDg2ZDNlZjI2YQ==
6
+ ZGQ3MDJhMmVlZGMyMWViMDEwNmE2MjM3NGIyMmQ5YzZhYjY2MDQ2Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NGZkYThlMzdiYWU5MGY4OTE5NWQxODBkZDUyZDUzZjRhMTAxNTE3YzRlZjc0
10
- MTYyYWZjMTBiMDZhOWZmOGZhOTFkNjcwMjE3OTliNTBlODBmYTNlYTU0YmIx
11
- ZDg3MDkxZTIwNTIxODlmZjEwYWI4ZmJlODFjMDdkYTY3MjhlOTk=
9
+ NmMwYTM0N2RkMThkYzEwYzAyMmZhYjk3NTg1NDhhNjJlMDViMjc0YzU2Yjll
10
+ NmI1MDJiMjExNGMwNTVlNDFiODdjOTE5ZmI0YmRhYzFmODc3N2QyMjEwNDkx
11
+ YzAxMWM2NjdiNDQwMGRiYzI2MjU1MTk5NzY5MmU5MDMzNWRmYTA=
12
12
  data.tar.gz: !binary |-
13
- OTgyYmQ4NTI3MWU1OGM4MjBiYzlmYmEzNmVlYTY1ZjQxYjU5MTQ0YzQ5NjQw
14
- ODgxZjZhMGIzMjI5ZWNiODg1NjU2NDA1MGU1MDQ5NDU3ZWY4OTczMmMxOGNm
15
- ODQ3NzM4YWE3YTE5MmFiNDYzN2I3ODM0ODFiOTlhZTk3ZTE3NjE=
13
+ Nzc4NzA4Yjk1YjU2ZDM5YTNhZTFiOTdhNmFkMzc4YmY5YmU5MDEwNTBiNTAy
14
+ ZmQ1NTQ2OTRlODRhNjZlNWE4NWUxODk2Y2YzZjlhMTc4ZDVjMGUzYjRlZDE1
15
+ YzZlNDYyMDgyMGU1ZTVlMDk2NTNhYjc3MjcxMmM0YzI1N2E5ZmI=
@@ -10,31 +10,43 @@ namespace :deploy do
10
10
  desc "deploys to staging server"
11
11
  task :staging do
12
12
  puts "====> deploying to staging..."
13
- `git checkout master`
14
- `git pull`
15
- rebase_to_master('staging')
16
- deploy(:staging)
17
- `git checkout master`
13
+ run 'git checkout master'
14
+ run 'git pull'
15
+ if rebase_to_master('staging')
16
+ deploy(:staging)
17
+ end
18
+ run 'git checkout master'
18
19
  end
19
20
 
20
21
  desc "deploys to production server"
21
22
  task :production do
22
23
  puts "====> deploying to production..."
23
- `git checkout master`
24
- `git pull`
25
- rebase_to_master('production')
26
- deploy(:production)
27
- `git checkout master`
24
+ run 'git checkout master'
25
+ run 'git pull'
26
+ if rebase_to_master('production')
27
+ deploy(:production)
28
+ end
29
+ run 'git checkout master'
28
30
  end
29
31
 
30
32
  end
31
33
 
34
+ def run(comand)
35
+ puts comand
36
+ `#{comand}`
37
+ if $?.success?
38
+ true
39
+ else
40
+ raise "'#{comand}' failed. finishing..."
41
+ end
42
+ end
43
+
32
44
  def rebase_to_master(branch_name)
33
45
  if local_branch_exists?(branch_name)
34
- `git checkout #{branch_name}`
35
- `git rebase master`
46
+ run "git checkout #{branch_name}"
47
+ run 'git rebase master'
36
48
  else
37
- `git checkout -b #{branch_name}`
49
+ run "git checkout -b #{branch_name}"
38
50
  end
39
51
  end
40
52
 
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.2.0
4
+ version: 0.2.1
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-17 00:00:00.000000000 Z
11
+ date: 2014-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties