-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cuberfile
48 lines (38 loc) · 2.88 KB
/
Cuberfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
app ENV['KUBE_NAMESPACE'] || 'hophub'
# Get the code from this Git repository
repo '.'
dockerfile 'Dockerfile'
# Publish the Docker image in a registry
image File.read('deploy/docker.repo').strip
# Connect to this Kubernetes cluster
kubeconfig ENV['KUBECONFIG']
migrate 'bundle exec rails db:migrate'
env 'SECRET_KEY_BASE', File.read("#{ENV['CONFIG_ROOT']}/secrets/secret_key_base").strip, secret: true
env 'ALTCHA_HMAC_KEY', File.read("#{ENV['CONFIG_ROOT']}/secrets/altcha.hmac_key").strip, secret: true
env 'MAPTILER_API_KEY', File.read("#{ENV['CONFIG_ROOT']}/secrets/maptiler.api_key").strip, secret: true
env 'HOPHUB_BASE_URL', File.read("#{ENV['CONFIG_ROOT']}/config/base_url").strip
env 'HOPHUB_DATABASE_USERNAME', File.read("#{ENV['CONFIG_ROOT']}/config/db.username").strip
env 'HOPHUB_DATABASE_PASSWORD', File.read("#{ENV['CONFIG_ROOT']}/secrets/db.password").strip, secret: true
env 'HOPHUB_DATABASE_HOST', File.read("#{ENV['CONFIG_ROOT']}/config/db.host").strip
env 'HOPHUB_DATABASE_PORT', File.read("#{ENV['CONFIG_ROOT']}/config/db.port").strip
env 'HOPHUB_DATABASE_NAME', File.read("#{ENV['CONFIG_ROOT']}/config/db.name").strip
env 'HOPHUB_MAIL_SERVER', File.read("#{ENV['CONFIG_ROOT']}/config/mail.server").strip
env 'HOPHUB_MAIL_PORT', File.read("#{ENV['CONFIG_ROOT']}/config/mail.port").strip
env 'HOPHUB_MAIL_FROM', File.read("#{ENV['CONFIG_ROOT']}/config/mail.from").strip
env 'HOPHUB_MAIL_DOMAIN', File.read("#{ENV['CONFIG_ROOT']}/config/mail.domain").strip
env 'HOPHUB_MAIL_USERNAME', File.read("#{ENV['CONFIG_ROOT']}/config/mail.username").strip rescue nil
env 'HOPHUB_MAIL_PASSWORD', File.read("#{ENV['CONFIG_ROOT']}/config/mail.password").strip rescue nil
env 'HOPHUB_MAIL_EVENT_CONFIRMED_BCC', File.read("#{ENV['CONFIG_ROOT']}/config/mail.event_confirmed_bcc").strip rescue nil
env 'HOPHUB_MAIL_GDPR_RESPONSE_BCC', File.read("#{ENV['CONFIG_ROOT']}/config/mail.gdpr_response_bcc").strip rescue nil
env 'HOPHUB_SINGLE_EVENT_ID', File.read("#{ENV['CONFIG_ROOT']}/config/single_event_id").strip rescue nil
env 'HOPHUB_INSTANCE_MASTODON_LINK', File.read("#{ENV['CONFIG_ROOT']}/config/mastodon_link").strip rescue nil
env 'HOPHUB_INSTANCE_PROJECT_HOME', File.read("#{ENV['CONFIG_ROOT']}/config/home_link").strip rescue nil
env 'EXCEPTION_NOTIFIER_SENDER', File.read("#{ENV['CONFIG_ROOT']}/config/exception_notifier.sender_address").strip rescue nil
env 'EXCEPTION_NOTIFIER_RECIPIENT', File.read("#{ENV['CONFIG_ROOT']}/config/exception_notifier.recipient").strip rescue nil
env 'PLAUSIBLE_DOMAIN', File.read("#{ENV['CONFIG_ROOT']}/config/plausible.domain").strip rescue nil
env 'PLAUSIBLE_SRC', File.read("#{ENV['CONFIG_ROOT']}/config/plausible.src").strip rescue nil
# Run and scale any command on Kubernetes
proc :web, 'bundle exec rails s', scale: 4
proc :metrics, 'bundle exec rails s', scale: 1
health File.read('deploy/config/base_url').strip + '/up'
cron :cleanup, '@hourly', 'bundle exec rails hophub:cleanup'