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

Fix: configuring capistrano for deployment #1

Merged
merged 2 commits into from
Mar 5, 2025
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
7 changes: 1 addition & 6 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set :author, "ontoportal-lirmm"
set :author, "lovportal"
set :application, "ontologies_api"
set :repo_url, "https://github.com/#{fetch(:author)}/#{fetch(:application)}.git"

Expand Down Expand Up @@ -38,17 +38,12 @@

# If you want to restart using `touch tmp/restart.txt`, add this to your config/deploy.rb:

SSH_JUMPHOST = ENV.include?('SSH_JUMPHOST') ? ENV['SSH_JUMPHOST'] : 'jumpbox.hostname.com'
SSH_JUMPHOST_USER = ENV.include?('SSH_JUMPHOST_USER') ? ENV['SSH_JUMPHOST_USER'] : 'username'

JUMPBOX_PROXY = "#{SSH_JUMPHOST_USER}@#{SSH_JUMPHOST}"
set :ssh_options, {
user: 'ontoportal',
forward_agent: 'true',
keys: %w(config/deploy_id_rsa),
auth_methods: %w(publickey),
# use ssh proxy if API servers are on a private network
proxy: Net::SSH::Proxy::Command.new("ssh #{JUMPBOX_PROXY} -W %h:%p")
}

# private git repo for configuraiton
Expand Down
17 changes: 17 additions & 0 deletions config/deploy/lovportal.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
# Don't declare `role :all`, it's a meta role
role :app, %w[lovportal.lirmm.fr]
role :db, %w[lovportal.lirmm.fr] # sufficient to run db:migrate only on one system
set :branch, ENV.include?('BRANCH') ? ENV['BRANCH'] : 'master'
# Extended Server Syntax
# ======================
# This can be used to drop a more detailed server
# definition into the server list. The second argument
# something that quacks like a hash can be used to set
# extended properties on the server.
# server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
set :log_level, :error
Loading