Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade kamal from 1.9.1 to 2.2.2 #559

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .kamal/hooks/pre-connect

This file was deleted.

11 changes: 11 additions & 0 deletions .kamal/secrets
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
KAMAL_REGISTRY_USERNAME=$KAMAL_REGISTRY_USERNAME
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD

RAILS_MASTER_KEY=$RAILS_MASTER_KEY

REDIS_URL=$REDIS_URL

LITESTREAM_ACCESS_KEY_ID=$LITESTREAM_ACCESS_KEY_ID
LITESTREAM_SECRET_ACCESS_KEY=$LITESTREAM_SECRET_ACCESS_KEY
LITESTREAM_BUCKET=$LITESTREAM_BUCKET
LITESTREAM_REGION=$LITESTREAM_REGION
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby file: ".ruby-version"

gem "dotenv-rails"

gem "rails", github: "rails/rails"

gem "dotenv-rails", require: "dotenv/load"

# Drivers
gem "sqlite3"
gem "puma"
Expand Down
25 changes: 8 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ GEM
activesupport (>= 5.2.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
airrecord (1.0.12)
faraday (>= 1.0, < 3.0)
faraday-net_http_persistent
net-http-persistent
appsignal (4.0.9)
logger
rack
Expand Down Expand Up @@ -189,10 +185,10 @@ GEM
irb (~> 1.10)
reline (>= 0.3.8)
debug_inspector (1.2.0)
dotenv (2.8.1)
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
railties (>= 3.2)
dotenv (3.1.4)
dotenv-rails (3.1.4)
dotenv (= 3.1.4)
railties (>= 6.1)
drb (2.2.1)
ed25519 (1.3.0)
erubi (1.13.0)
Expand All @@ -206,9 +202,6 @@ GEM
faraday (>= 1, < 3)
faraday-net_http (3.3.0)
net-http
faraday-net_http_persistent (2.1.0)
faraday (~> 2.5)
net-http-persistent (~> 4.0)
ferrum (0.15)
addressable (~> 2.5)
concurrent-ruby (~> 1.1)
Expand Down Expand Up @@ -249,16 +242,16 @@ GEM
activesupport (>= 5.0.0)
jmespath (1.6.2)
json (2.7.2)
kamal (1.9.1)
kamal (2.2.2)
activesupport (>= 7.0)
base64 (~> 0.2)
bcrypt_pbkdf (~> 1.0)
concurrent-ruby (~> 1.2)
dotenv (~> 2.8)
dotenv (~> 3.1)
ed25519 (~> 1.2)
net-ssh (~> 7.0)
sshkit (>= 1.23.0, < 2.0)
thor (~> 1.2)
thor (~> 1.3)
zeitwerk (~> 2.5)
language_server-protocol (3.17.0.3)
launchy (3.0.1)
Expand Down Expand Up @@ -295,8 +288,6 @@ GEM
msgpack (1.7.2)
net-http (0.4.1)
uri
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
net-imap (0.4.16)
date
net-protocol
Expand All @@ -310,7 +301,7 @@ GEM
net-ssh (>= 5.0.0, < 8.0.0)
net-smtp (0.5.0)
net-protocol
net-ssh (7.2.3)
net-ssh (7.3.0)
nio4r (2.7.3)
nokogiri (1.16.7-aarch64-linux)
racc (~> 1.4)
Expand Down
26 changes: 13 additions & 13 deletions config/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
minimum_version: 1.1.0
<% ENV["RAILS_ENV"] = "production" %>
<% require_relative "config/application" %>

service: hackathons
minimum_version: 2.2.2

service: hackathons
image: hackclub/hackathons

servers:
Expand All @@ -27,7 +29,7 @@ registry:
- KAMAL_REGISTRY_PASSWORD

builder:
multiarch: false
arch: amd64
cache:
type: gha
options: mode=max
Expand All @@ -40,8 +42,12 @@ env:
- RAILS_MASTER_KEY
- REDIS_URL

asset_path: "/hackathons/public/assets"
volumes: ["hackathons-storage:/hackathons/storage"]

proxy:
app_port: 3000

accessories:
litestream:
roles: ["web"]
Expand All @@ -51,13 +57,7 @@ accessories:
cmd: replicate
env:
secret:
- LITESTREAM_ACCESS_KEY_ID
- LITESTREAM_SECRET_ACCESS_KEY
- LITESTREAM_BUCKET
- LITESTREAM_REGION

asset_path: "/hackathons/public/assets"

traefik:
args:
entrypoints.web.forwardedHeaders.trustedIPs: 10.0.0.0/8
<% %w[BUCKET REGION ACCESS_KEY_ID SECRET_ACCESS_KEY].each do |secret| %>
<% ENV["LITESTREAM_#{secret}"] = Rails.application.credentials.aws!.fetch(secret.downcase.to_sym) %>
- LITESTREAM_<%= secret %>
<% end %>