railman-deployment 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/railman/tasks/deployment.rake +17 -19
- data/lib/railman-deployment/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 676fe8d7b3463a4f37d6fc785c888413bec3272f
|
4
|
+
data.tar.gz: f546d4b31ead1df2082c6eacb691e45467a56494
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41af320341d6499f8f1ebd492a7aa29b12214d7784bb89e98caeb72376c8ac4851334ca4cde94c9b0f3e9d0f25996868da1d8d737a6bd3e89aea5d3cbbfef592
|
7
|
+
data.tar.gz: e919bd6d76c89745021b08868018a89ffd0eeafb886736aef87de0ab6fe3c2c4585e6655b3acd4e0d24eceb6552217597902a1f92e2c02c334f4de5af0e4e4f0
|
@@ -36,25 +36,23 @@ end
|
|
36
36
|
desc 'Setup spa application for the first time on a server'
|
37
37
|
task :setup_spa do
|
38
38
|
on roles(:all) do
|
39
|
-
|
40
|
-
|
41
|
-
if fetch(:
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
39
|
+
server_conf_dir = "#{fetch(:deploy_to)}/config/server"
|
40
|
+
if fetch(:spa_application)
|
41
|
+
if test "[ -d #{fetch(:deploy_spa_to)} ]"
|
42
|
+
invoke :fetch_and_reset_spa_git_repository
|
43
|
+
else
|
44
|
+
execute :git, :clone, fetch(:spa_repo_url), fetch(:deploy_spa_to)
|
45
|
+
end
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end
|
47
|
+
within fetch(:deploy_spa_to) do
|
48
|
+
execute :mkdir, "-p #{fetch(:deploy_spa_to)}/public"
|
49
|
+
execute :yarn
|
50
|
+
execute :yarn, 'run build'
|
51
|
+
execute "rsync -avz --delete #{fetch(:deploy_spa_to)}/dist/ #{fetch(:deploy_spa_to)}/public/"
|
52
|
+
execute :cp, "#{server_conf_dir}/nginx_spa.conf /etc/nginx/sites-available/#{fetch(:spa_domain)}"
|
53
|
+
execute :ln, "-s -f /etc/nginx/sites-available/#{fetch(:spa_domain)} /etc/nginx/sites-enabled/"
|
54
|
+
execute :service, 'nginx restart'
|
55
|
+
execute :certbot, "--nginx -d #{fetch(:spa_domain)}"
|
58
56
|
end
|
59
57
|
end
|
60
58
|
end
|
@@ -108,7 +106,7 @@ task :deploy_spa do
|
|
108
106
|
invoke :fetch_and_reset_spa_git_repository
|
109
107
|
execute :yarn
|
110
108
|
execute :yarn, 'run build'
|
111
|
-
execute "rsync -avz --delete
|
109
|
+
execute "rsync -avz --delete #{fetch(:deploy_spa_to)}/dist/ #{fetch(:deploy_spa_to)}/public/"
|
112
110
|
execute :service, 'nginx restart'
|
113
111
|
end if test "[ -d #{fetch(:deploy_spa_to)} ]"
|
114
112
|
end
|