bard 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f5ecd87f7e75c849307787fa9cbbdc3deda8bff5a00c697cfd74e998817cd97
4
- data.tar.gz: 8188084e5da82c13e25a85d65d2ce72e17def72a1b532850ca033d3d95b975bd
3
+ metadata.gz: 62659c90d5cd7cf39ef14edf5b0146338d0571fff437df85040d4cdcb0d82ff0
4
+ data.tar.gz: e3ac33d2ca9513a925060561a3a40608236346ee87a2beaca6524f8922da1bdd
5
5
  SHA512:
6
- metadata.gz: f88de372c1f5a318ed1fc8ccf5796301d6128d876b7f0df1a78efd07760b3c91655a39d0cf8d4bca91d57c0fcf22534660b9df71d14c475d3927bb316a752ab1
7
- data.tar.gz: cfb453652fda76f97812f2c42662a7fe6de43b0ffd666688ce4351a3c7079a3d793f8fd5d0975e21dacdfb4baf7f523705c5a1da41856299f4212de8d34c1ca9
6
+ metadata.gz: 9b50ddaeba02751089df9469427a663ebd36481115c01a1e72e808f96d9a869fd929cbf20df185668536b91e1c838090c82b41a1b05b0af990ebd31a328c3b3c
7
+ data.tar.gz: 638a531d23991f1fd01e284eaf1951994da92ab6ad695d1c9a53d10e814c7be91c5c3c487a90dd9b45d3443000f7e029198451140876d4674e68e162bc29420e
@@ -17,7 +17,7 @@ Feature: Bard can check its environment for missing dependencies and potential p
17
17
  And the database is missing
18
18
  When I type "bard check"
19
19
  Then I should see the fatal error "missing database"
20
-
20
+
21
21
  Scenario: Bard check detects pending migrations
22
22
  Given a shared rails project
23
23
  And a commit with a new migration
@@ -42,7 +42,7 @@ Feature: bard push
42
42
  Then on staging, there should be one new submodule
43
43
  And the submodule branch should match the submodule origin branch
44
44
  And on staging, the submodule working directory should be clean
45
-
45
+
46
46
  Scenario: Pushing a change that includes a submodule update
47
47
  Given a submodule
48
48
  And a commit with a submodule update
@@ -6,39 +6,50 @@ module Bard::CLI::Setup
6
6
 
7
7
  desc "setup", "installs app in nginx"
8
8
  def setup
9
- path = "/etc/nginx/sites-available/#{project_name}"
10
- dest_path = path.sub("sites-available", "sites-enabled")
11
- server_name = case ENV["RAILS_ENV"]
12
- when "production"
13
- (config[:production].ping.map do |str|
14
- "*.#{URI.parse(str).host}"
15
- end + ["_"]).join(" ")
16
- when "staging" then "#{project_name}.botandrose.com"
17
- else "#{project_name}.localhost"
18
- end
19
-
20
- system "sudo tee #{path} >/dev/null <<-EOF
21
- server {
22
- listen 80;
23
- server_name #{server_name};
9
+ system "sudo tee /etc/nginx/snippets/common.conf >/dev/null <<-EOF
10
+ listen 80;
24
11
 
25
- root #{Dir.pwd}/public;
26
- passenger_enabled on;
12
+ passenger_enabled on;
27
13
 
28
- location ~* \\.(ico|css|js|gif|jp?g|png|webp) {
14
+ location ~* \\.(ico|css|js|gif|jp?g|png|webp) {
29
15
  access_log off;
30
16
  if (\\$request_filename ~ \"-[0-9a-f]{32}\\.\") {
31
- expires max;
32
- add_header Cache-Control public;
17
+ expires max;
18
+ add_header Cache-Control public;
33
19
  }
34
- }
35
- gzip_static on;
20
+ }
21
+
22
+ gzip_static on;
23
+ EOF"
24
+
25
+ path = "/etc/nginx/sites-available/#{project_name}"
26
+ system "sudo tee #{path} >/dev/null <<-EOF
27
+ server {
28
+ include /etc/nginx/snippets/common.conf;
29
+ server_name #{nginx_server_name};
30
+ root #{Dir.pwd}/public;
36
31
  }
37
32
  EOF"
33
+
34
+ dest_path = path.sub("sites-available", "sites-enabled")
38
35
  system "sudo ln -sf #{path} #{dest_path}" if !File.exist?(dest_path)
36
+
39
37
  system "sudo service nginx restart"
40
38
  end
41
39
 
40
+ private
41
+
42
+ def nginx_server_name
43
+ case ENV["RAILS_ENV"]
44
+ when "production"
45
+ (config[:production].ping.map do |str|
46
+ "*.#{URI.parse(str).host}"
47
+ end + ["_"]).join(" ")
48
+ when "staging" then "#{project_name}.botandrose.com"
49
+ else "#{project_name}.localhost"
50
+ end
51
+ end
52
+
42
53
  end
43
54
  end
44
55
  end
data/lib/bard/config.rb CHANGED
@@ -10,7 +10,7 @@ module Bard
10
10
  :local,
11
11
  false,
12
12
  "./",
13
- false,
13
+ "#{project_name}.local",
14
14
  ),
15
15
  gubs: Server.new(
16
16
  project_name,
@@ -22,14 +22,16 @@ module Bard
22
22
  ci: Server.new(
23
23
  project_name,
24
24
  :ci,
25
- "jenkins@ci.botandrose.com:22022",
25
+ "jenkins@staging.botandrose.com:22022",
26
26
  "jobs/#{project_name}/workspace",
27
27
  false,
28
28
  ),
29
29
  staging: Server.new(
30
30
  project_name,
31
31
  :staging,
32
- "www@#{project_name}.botandrose.com:22022",
32
+ "www@staging.botandrose.com:22022",
33
+ project_name,
34
+ "#{project_name}.botandrose.com",
33
35
  ),
34
36
  }
35
37
  if path && File.exist?(path)
@@ -27,7 +27,7 @@ class Bard::Provision::SSH < Bard::Provision
27
27
  ssh_url << ":#{target_port}"
28
28
  puts " ✓"
29
29
  end
30
-
30
+
31
31
  private
32
32
 
33
33
  def target_port
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel