-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
- Loading branch information
1 parent
00f95e8
commit cd2dd1d
Showing
18 changed files
with
167 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
D0nwCgGGKi4dRRKzXsDLy/WUYTjEfhlH32itOEDWnpqC4gvK+Rh46aOYw9OdXcBQzyS656Gko7PoxwFHrQd3cEkoYX6u80IDNueByrvYSZ96t6uO1o8mFACdOFsqHcTw6FVuDbjs8eZ7nlCYO8usF6XcXQVD4Y+gUWIEI5kffZd8+QcA23X0/qNiBJCo4HyEZy00nNFusPKVHU6dA+gqB0bI4stF0gvDw4dzO2M+RpyEK7dvbtAGnh2xjd9s6KPKhOkZYmlyr6L4hYpldjyJC2PHux3hVbBJcBEGERSegsNn1yRNIigji9GO8b/mdKij0XmRcTdbJb0Ee//BAt788rxhn7g9jtRRJarfLbeJ8y3jLzTfGG8nfRIh7Qzzj6Zj2SMGbecvl8LI3Trs4rrd+9Ox9ClUBr3P7UcRYMUOLoET9DGwwOLBlZfdAelJ+8Fyx1VooSkdZbE8EGPyBhrzSLiQ2+pPntni0JEAYIkMRa79sxI6K+ZaAOF9Sm+sucf8TSVMbZBtSPtwdgstN2BjBqHbMjI1VWBZmNI+6jFz1yaDacv81BJYY13nVAgIN4JtmpnvDQM9+G0j+2DeAMUe3VD6T2ezVtCAU3wywAjjw+tMb9cSoJ54GC4/9wFNxFYJVYrR--5CdebogqddXr/kbi--4Wb6gGOLohamWJAKQb6Lsw== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
set :branch, :main | ||
|
||
server 'ikt.edu.vn.ua:10017', user: 'arch-user', roles: %i[app web db] | ||
set :deploy_to, '/opt/ai/ikt.codelabs.site' | ||
|
||
set :rails_env, :production | ||
|
||
server 'ikt.codelabs.site:10017', user: 'arch-user', roles: %i[app web db] | ||
|
||
namespace :deploy do | ||
after :finishing, 'ikt_application:restart' | ||
after :finishing, 'nginx:reload' | ||
after :finishing, 'bundler:clean' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set :branch, :main | ||
|
||
set :deploy_to, '/opt/ai/stage-ikt.codelabs.site' | ||
|
||
set :rails_env, :staging | ||
|
||
append :linked_files, 'config/credentials/staging.key' | ||
|
||
server 'stage-ikt.codelabs.site:10016', user: 'arch-user', roles: %i[app web db] | ||
|
||
namespace :deploy do | ||
after :finishing, 'stage_application:restart' | ||
after :finishing, 'nginx:reload' | ||
after :finishing, 'bundler:clean' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
production.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
upstream stage_backend { | ||
server unix:///opt/ai/stage-ikt.codelabs.site/current/tmp/sockets/server.sock fail_timeout=0; | ||
} | ||
|
||
server { | ||
listen *:80; | ||
server_name stage-ikt.codelabs.site; | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
server { | ||
listen *:443; | ||
server_name stage-ikt.codelabs.site; | ||
client_max_body_size 1024M; | ||
root /opt/ai/stage-ikt.codelabs.site/current/public/; | ||
error_log /opt/ai/stage-ikt.codelabs.site/current/log/nginx_errors.log; | ||
|
||
gzip on; | ||
gzip_comp_level 6; | ||
gzip_proxied any; | ||
gzip_types text/plain text/css application/javascript application/octet-stream; | ||
|
||
location @stage_backend { | ||
proxy_pass http://stage_backend; | ||
proxy_redirect off; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
|
||
location /cable { | ||
proxy_pass http://stage_backend; | ||
proxy_set_header Connection Upgrade; | ||
proxy_set_header Upgrade websocket; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
|
||
location /assets { | ||
expires max; | ||
try_files $uri @stage_backend; | ||
} | ||
|
||
location / { | ||
try_files $uri @stage_backend; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[Unit] | ||
Description = IKT Application | ||
After = network.service | ||
|
||
[Service] | ||
User = arch-user | ||
Group = arch-user | ||
WorkingDirectory = /opt/ai/ikt.codelabs.site/current | ||
Environment = 'RAILS_ENV=production' | ||
Environment = 'SOCKET=unix:///opt/ai/ikt.codelabs.site/current/tmp/sockets/server.sock' | ||
Environment = 'PIDFILE=/opt/ai/ikt.codelabs.site/current/tmp/pids/server.pid' | ||
Environment = 'PATH=/home/arch-user/.rbenv/versions/3.1.2/bin:/usr/local/sbin:/usr/local/bin:/usr/bin' | ||
ExecStart = /usr/bin/env bundle exec puma --config /opt/ai/ikt.codelabs.site/current/config/puma.rb | ||
Restart = always | ||
|
||
[Install] | ||
WantedBy = multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[Unit] | ||
Description = Stage IKT Application | ||
After = network.service | ||
|
||
[Service] | ||
User = arch-user | ||
Group = arch-user | ||
WorkingDirectory = /opt/ai/stage-ikt.codelabs.site/current | ||
Environment = 'RAILS_ENV=staging' | ||
Environment = 'SOCKET=unix:///opt/ai/stage-ikt.codelabs.site/current/tmp/sockets/server.sock' | ||
Environment = 'PIDFILE=/opt/ai/stage-ikt.codelabs.site/current/tmp/pids/server.pid' | ||
Environment = 'PATH=/home/arch-user/.rbenv/versions/3.1.2/bin:/usr/local/sbin:/usr/local/bin:/usr/bin' | ||
ExecStart = /usr/bin/env bundle exec puma --config /opt/ai/stage-ikt.codelabs.site/current/config/puma.rb | ||
Restart = always | ||
|
||
[Install] | ||
WantedBy = multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace :stage_application do | ||
desc 'Start application' | ||
task :start do | ||
on roles(:app), in: :sequence, wait: 5 do | ||
within current_path do | ||
execute 'sudo systemctl start stage-ikt.codelabs.site' | ||
end | ||
end | ||
end | ||
|
||
desc 'Stop application' | ||
task :stop do | ||
on roles(:app), in: :sequence, wait: 5 do | ||
within current_path do | ||
execute 'sudo systemctl stop stage-ikt.codelabs.site' | ||
end | ||
end | ||
end | ||
|
||
desc 'Restart application' | ||
task :restart do | ||
on roles(:app), in: :sequence, wait: 5 do | ||
within current_path do | ||
execute 'sudo systemctl restart stage-ikt.codelabs.site' | ||
end | ||
end | ||
end | ||
end |