bard 0.29.0 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bard.rb +4 -0
- data/lib/bard/capistrano.rb +9 -24
- data/lib/bard/version.rb +1 -1
- 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: 719e47d893872fefe3cfd4dfe73ddb4f68d10ad9
|
4
|
+
data.tar.gz: a3b3e76ac8fc203fe45d517b7655b5e2bbaab062
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a2924218f5827b6b65b28005d5268cab74cefc234ef6b52f08b28d15ea3314cf003a54179c233c86893136f49c847980b48588711f20c7eb0ce0c3c7adc146c
|
7
|
+
data.tar.gz: 7bc7b1940e0984957315ee22845f363cd3657bb172cb12cae68c22befcdf6486a533901a76a086482b6d01b05e0df00824c477cc642d7f13720e2d2a5ad0c72f
|
data/lib/bard.rb
CHANGED
@@ -25,6 +25,10 @@ class Bard::CLI < Thor
|
|
25
25
|
method_options %w( verbose -v ) => :boolean
|
26
26
|
desc "stage", "pushes current branch, and stages it"
|
27
27
|
def stage
|
28
|
+
unless File.read("Capfile").include?("role :production")
|
29
|
+
raise Thor::Error.new("`bard stage` is disabled until a production server is defined. Until then, please use `bard deploy` to deploy to the staging server.")
|
30
|
+
end
|
31
|
+
|
28
32
|
branch = Git.current_branch
|
29
33
|
|
30
34
|
run_crucial "git push -u origin #{branch}", true
|
data/lib/bard/capistrano.rb
CHANGED
@@ -16,8 +16,6 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
16
16
|
namespace "pull" do
|
17
17
|
desc "pull data"
|
18
18
|
task "default" do
|
19
|
-
exec "heroku db:pull --confirm #{project_name}" if heroku?(ENV["ROLES"])
|
20
|
-
|
21
19
|
run "cd #{application} && bundle exec rake db:dump && gzip -9f db/data.sql"
|
22
20
|
transfer :down, "#{application}/db/data.sql.gz", "db/data.sql.gz"
|
23
21
|
system "gunzip -f db/data.sql.gz && bundle exec rake db:load"
|
@@ -63,32 +61,19 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
63
61
|
|
64
62
|
desc "push app to production"
|
65
63
|
task :deploy do
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
find_and_execute_task "rvm:install_ruby"
|
72
|
-
system "git push github" if `git remote` =~ /\bgithub\b/
|
73
|
-
run "cd #{application} && git pull origin master && bin/setup", :roles => :production
|
74
|
-
end
|
64
|
+
deploy_roles = roles.keys.include?(:production) ? :production : :staging
|
65
|
+
ENV["ROLES"] = deploy_roles.to_s
|
66
|
+
find_and_execute_task "rvm:install_ruby"
|
67
|
+
system "git push github" if `git remote` =~ /\bgithub\b/
|
68
|
+
run "cd #{application} && git pull origin master && bin/setup", roles: deploy_roles
|
75
69
|
end
|
76
70
|
|
77
71
|
desc "push app to staging"
|
78
72
|
task :stage do
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
ENV["ROLES"] = "staging"
|
84
|
-
find_and_execute_task "rvm:install_ruby"
|
85
|
-
branch = ENV.fetch("BRANCH")
|
86
|
-
run "cd #{application} && git fetch && git checkout -f origin/#{branch} && bin/setup", :roles => :staging
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
def heroku? role
|
91
|
-
`git remote -v`.include? "#{role}\tgit@heroku.com:"
|
73
|
+
ENV["ROLES"] = "staging"
|
74
|
+
find_and_execute_task "rvm:install_ruby"
|
75
|
+
branch = ENV.fetch("BRANCH")
|
76
|
+
run "cd #{application} && git fetch && git checkout -f origin/#{branch} && bin/setup", :roles => :staging
|
92
77
|
end
|
93
78
|
|
94
79
|
desc "log in via ssh"
|
data/lib/bard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|