bard 1.0.6 → 1.0.8

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: 1d8accacf270a551abbd5d6acac6a3bd1d2cfdadc04f840a272c2de65559d00a
4
+ data.tar.gz: 1229036cf1eb5a98be113f205085b1770a88aefd9bc92b476b9a33c96395d5c1
5
5
  SHA512:
6
- metadata.gz: f88de372c1f5a318ed1fc8ccf5796301d6128d876b7f0df1a78efd07760b3c91655a39d0cf8d4bca91d57c0fcf22534660b9df71d14c475d3927bb316a752ab1
7
- data.tar.gz: cfb453652fda76f97812f2c42662a7fe6de43b0ffd666688ce4351a3c7079a3d793f8fd5d0975e21dacdfb4baf7f523705c5a1da41856299f4212de8d34c1ca9
6
+ metadata.gz: ca2b041802f628bc879a42bdd117802eeef533c98e31e633e2a93221d5c91e68f12c327fe5cb1840f7da6a044ccc84ecfb53dce39d92f36a66af741af6ae8d2b
7
+ data.tar.gz: 7b65fd1eecf7e4b894e8b9ae004c7760d824f334a8a9208686a63de248104b4eb132bdf4899bbb45df5f1c549c0997612d89279624201c4248d11d9e9e2ac5eb
@@ -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.8"
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.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel