From eb6b6a3ffaf583eb9742b515d30d966d17485d87 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Sun, 24 Sep 2023 02:00:05 +0200 Subject: [PATCH] add deployment scripts --- Gemfile | 6 ++--- Gemfile.lock | 18 +++++++------- config/deploy/appliance.rb | 49 ------------------------------------- config/deploy/production.rb | 48 +++++++++--------------------------- 4 files changed, 23 insertions(+), 98 deletions(-) delete mode 100644 config/deploy/appliance.rb diff --git a/Gemfile b/Gemfile index 37e66728..5ea91059 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'activesupport', '~> 3.1' +gem 'activesupport', '~> 3.2' # see https://github.com/ncbo/ontologies_api/issues/69 gem 'bigdecimal', '1.4.2' gem 'faraday', '~> 1.9' @@ -16,7 +16,7 @@ gem 'sinatra-contrib', '~> 1.0' gem 'request_store' # Rack middleware -gem 'ffi' +gem 'ffi', '~> 1.15.5' gem 'rack-accept', '~> 0.4' gem 'rack-attack', '~> 6.6.1', require: 'rack/attack' gem 'rack-cache', '~> 1.13.0' @@ -49,7 +49,7 @@ gem 'ncbo_annotator', git: 'https://github.com/ontoportal-lirmm/ncbo_annotator.g gem 'ncbo_cron', git: 'https://github.com/ontoportal-lirmm/ncbo_cron.git', branch: 'master' gem 'ncbo_ontology_recommender', git: 'https://github.com/ncbo/ncbo_ontology_recommender.git', branch: 'master' gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'master' -gem 'ontologies_linked_data', git: 'https://github.com/lifewatch-eric/ontologies_linked_data.git', branch: 'ecoportal-ontoportal-reset' +gem 'ontologies_linked_data', git: 'https://github.com/lifewatch-eric/ontologies_linked_data.git', branch: 'master' gem 'request_store' group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 76fce7fc..2fcba83d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/lifewatch-eric/ontologies_linked_data.git revision: 24700f186e2de4196ce471627338c9fc6ebdf73f - branch: ecoportal-ontoportal-reset + branch: master specs: ontologies_linked_data (0.0.1) activesupport @@ -105,7 +105,7 @@ GEM multi_json (~> 1.0) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) - airbrussh (1.4.2) + airbrussh (1.5.0) sshkit (>= 1.6.1, != 1.7.0) backports (3.24.1) bcrypt (3.1.19) @@ -171,7 +171,7 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick - googleauth (1.8.0) + googleauth (1.8.1) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) multi_json (~> 1.11) @@ -222,11 +222,11 @@ GEM timeout net-scp (4.0.0) net-ssh (>= 2.6.5, < 8.0.0) - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol net-ssh (7.2.0) netrc (0.11.0) - newrelic_rpm (9.4.2) + newrelic_rpm (9.5.0) oj (2.18.5) omni_logger (0.1.4) logger @@ -321,7 +321,7 @@ GEM net-ssh (>= 2.8.0) systemu (2.6.5) temple (0.10.2) - tilt (2.2.0) + tilt (2.3.0) timeout (0.4.0) trailblazer-option (0.1.2) tzinfo (2.0.6) @@ -345,7 +345,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - activesupport (~> 3.1) + activesupport (~> 3.2) bcrypt_pbkdf (>= 1.0, < 2.0) bigdecimal (= 1.4.2) capistrano (~> 3) @@ -355,7 +355,7 @@ DEPENDENCIES cube-ruby ed25519 (>= 1.2, < 2.0) faraday (~> 1.9) - ffi + ffi (~> 1.15.5) goo! haml (~> 5.2.2) json-schema (~> 2.0) @@ -397,4 +397,4 @@ DEPENDENCIES unicorn-worker-killer BUNDLED WITH - 2.3.23 + 2.4.12 diff --git a/config/deploy/appliance.rb b/config/deploy/appliance.rb deleted file mode 100644 index fdfe0d70..00000000 --- a/config/deploy/appliance.rb +++ /dev/null @@ -1,49 +0,0 @@ -# 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 - -# 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 'localhost', roles: %w{app} - -# you can set custom ssh options -# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options -# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) -# set it globally -# set :ssh_options, { -# keys: %w(/home/rlisowski/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(password) -# } -# and/or per server -# server 'example.com', -# user: 'user_name', -# roles: %w{web app}, -# ssh_options: { -# user: 'user_name', # overrides user setting above -# keys: %w(/home/user_name/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(publickey password) -# # password: 'please use keys' -# } -# setting per server overrides global ssh_options - -BRANCH = ENV.include?('BRANCH') ? ENV['BRANCH'] : 'master' -set :branch, "#{BRANCH}" -set :deploy_to, "/srv/ontoportal/#{fetch(:application)}" -# install gems into a common direcotry shared across ui, api and ncbo_cron to reduce disk usage -set :bundle_path, '/srv/ontoportal/.bundle' -remove :linked_dirs, 'vendor/bundle' - -# private git repo for configuraiton -# PRIVATE_CONFIG_REPO = ENV.include?('PRIVATE_CONFIG_REPO') ? ENV['PRIVATE_CONFIG_REPO'] : 'git@github.com:your_org/private-config-repo.git' - -# location of local configuration files -LOCAL_CONFIG_PATH = ENV.include?('LOCAL_CONFIG_PATH') ? ENV['LOCAL_CONFIG_PATH'] : '/srv/ontoportal/virtual_appliance/appliance_config' diff --git a/config/deploy/production.rb b/config/deploy/production.rb index c84d24ea..1339b1ef 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,39 +1,13 @@ -# 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{deploy@example.com} -role :web, %w{deploy@example.com} -role :db, %w{deploy@example.com} +set :branch, 'master' +set :server, 'ecoportal.lifewatch.eu' -# 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 +server fetch(:server), user: fetch(:user), roles: %w{web app} -# you can set custom ssh options -# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options -# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) -# set it globally -# set :ssh_options, { -# keys: %w(/home/rlisowski/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(password) -# } -# and/or per server -# server 'example.com', -# user: 'user_name', -# roles: %w{web app}, -# ssh_options: { -# user: 'user_name', # overrides user setting above -# keys: %w(/home/user_name/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(publickey password) -# # password: 'please use keys' -# } -# setting per server overrides global ssh_options +set :ssh_options, { + user: 'ontoportal', + forward_agent: 'true', + #keys: %w(config/deploy_id_rsa), + #auth_methods: %w(publickey), + # use ssh proxy if UI servers are on a private network + #proxy: Net::SSH::Proxy::Command.new('ssh deployer@sshproxy.ontoportal.org -W %h:%p') +}