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 +4 -4
- data/features/bard_check.feature +1 -1
- data/features/bard_push.feature +1 -1
- data/lib/bard/cli/setup.rb +33 -22
- data/lib/bard/config.rb +5 -3
- data/lib/bard/provision/ssh.rb +1 -1
- data/lib/bard/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d8accacf270a551abbd5d6acac6a3bd1d2cfdadc04f840a272c2de65559d00a
|
4
|
+
data.tar.gz: 1229036cf1eb5a98be113f205085b1770a88aefd9bc92b476b9a33c96395d5c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca2b041802f628bc879a42bdd117802eeef533c98e31e633e2a93221d5c91e68f12c327fe5cb1840f7da6a044ccc84ecfb53dce39d92f36a66af741af6ae8d2b
|
7
|
+
data.tar.gz: 7b65fd1eecf7e4b894e8b9ae004c7760d824f334a8a9208686a63de248104b4eb132bdf4899bbb45df5f1c549c0997612d89279624201c4248d11d9e9e2ac5eb
|
data/features/bard_check.feature
CHANGED
@@ -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
|
data/features/bard_push.feature
CHANGED
@@ -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
|
data/lib/bard/cli/setup.rb
CHANGED
@@ -6,39 +6,50 @@ module Bard::CLI::Setup
|
|
6
6
|
|
7
7
|
desc "setup", "installs app in nginx"
|
8
8
|
def setup
|
9
|
-
|
10
|
-
|
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
|
-
|
26
|
-
passenger_enabled on;
|
12
|
+
passenger_enabled on;
|
27
13
|
|
28
|
-
|
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
|
-
|
32
|
-
|
17
|
+
expires max;
|
18
|
+
add_header Cache-Control public;
|
33
19
|
}
|
34
|
-
|
35
|
-
|
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
|
-
|
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@
|
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
|
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)
|
data/lib/bard/provision/ssh.rb
CHANGED
data/lib/bard/version.rb
CHANGED