Skip to content

Commit

Permalink
MRSK setup - ready to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
tannakartikey committed Apr 5, 2023
1 parent 55629f0 commit 2d138e1
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env
@@ -0,0 +1,3 @@
MRSK_REGISTRY_PASSWORD=change-this
RAILS_MASTER_KEY=change-this
POSTGRES_PASSWORD=change-this
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -71,3 +71,5 @@ group :test do
gem "selenium-webdriver"
gem "webdrivers"
end

gem "mrsk", "~> 0.10.1"
18 changes: 18 additions & 0 deletions Gemfile.lock
Expand Up @@ -99,6 +99,7 @@ GEM
specs:
addressable (2.8.3)
public_suffix (>= 2.0.2, < 6.0)
bcrypt_pbkdf (1.1.0)
bindex (0.8.1)
bootsnap (1.16.0)
msgpack (~> 1.2)
Expand All @@ -119,6 +120,8 @@ GEM
debug (1.7.2)
irb (>= 1.5.0)
reline (>= 0.3.1)
dotenv (2.8.1)
ed25519 (1.3.0)
erubi (1.12.0)
globalid (1.1.0)
activesupport (>= 5.0)
Expand All @@ -145,6 +148,14 @@ GEM
matrix (0.4.2)
mini_mime (1.1.2)
minitest (5.18.0)
mrsk (0.10.1)
activesupport (>= 7.0)
bcrypt_pbkdf (~> 1.0)
dotenv (~> 2.8)
ed25519 (~> 1.2)
sshkit (~> 1.21)
thor (~> 1.2)
zeitwerk (~> 2.5)
msgpack (1.7.0)
net-imap (0.3.4)
date
Expand All @@ -153,8 +164,11 @@ GEM
net-protocol
net-protocol (0.2.1)
timeout
net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-smtp (0.3.3)
net-protocol
net-ssh (7.1.0)
nio4r (2.5.9)
nokogiri (1.14.2-x86_64-linux)
racc (~> 1.4)
Expand Down Expand Up @@ -193,6 +207,9 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.21.4)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stimulus-rails (1.2.1)
railties (>= 6.0.0)
tailwindcss-rails (2.0.27-x86_64-linux)
Expand Down Expand Up @@ -230,6 +247,7 @@ DEPENDENCIES
debug
importmap-rails
jbuilder
mrsk (~> 0.10.1)
pg (~> 1.1)
puma (>= 5.0)
rails!
Expand Down
27 changes: 27 additions & 0 deletions bin/mrsk
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'mrsk' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("mrsk", "mrsk")
3 changes: 2 additions & 1 deletion config/database.yml
Expand Up @@ -79,6 +79,7 @@ test:
#
production:
<<: *default
host: <%= ENV["DB_HOST"] %>
database: rails_71_mrsk_deploy_production
username: rails_71_mrsk_deploy
password: <%= ENV["RAILS_71_MRSK_DEPLOY_DATABASE_PASSWORD"] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
33 changes: 33 additions & 0 deletions config/deploy.yml
@@ -0,0 +1,33 @@
service: my-app
image: user/my-app

servers:
web:
- 134.209.111.91

# Credentials for your image host.
registry:
username: tannakartikey
password:
- MRSK_REGISTRY_PASSWORD

env:
clear:
DB_HOST: 134.209.111.91
secret:
- RAILS_MASTER_KEY
- POSTGRES_PASSWORD

accessories:
db:
image: postgres:15
host: 134.209.111.91
port: 5432
env:
clear:
POSTGRES_USER: 'rails_71_mrsk_deploy'
POSTGRES_DB: 'rails_71_mrsk_deploy_production'
secret:
- POSTGRES_PASSWORD
directories:
- data:/var/lib/postgresql/data

0 comments on commit 2d138e1

Please sign in to comment.