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

updating deployment instruction [#149970942] #1252

Merged
merged 1 commit into from
Feb 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 6 additions & 45 deletions DeploymentInstructions
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
Assumptions/Directions:
* You have obis-bridge alias for ssh in .ssh/config (this is needed because we have to bundle install the DeployGemfile to create a lock file)

* bundle install --gemfile DeployGemfile and then commit the DeployGemfile.lock

* mysql is installed and empty database has been created

* rvm is installed system wide

* add rvm_trust_rvmrcs_flag=1 to /etc/rvmrc

* set default ruby to one used by app ## not totally sure if this is necessary

* httpd is installed

* sudo gem install passenger
* gem install passenger

* rvmsudo passenger-install-apache2-module

* copy lines passenger provides into /etc/httpd/conf/httpd.conf
# this is an example only, use the information provided by phusion passenger
# load phusion passenger
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p286/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p286/gems/passenger-3.0.17

* create a conf file for the app /etc/httpd/conf.d/sparc-rails.conf and change the RackEnv
* create a conf file for the app /etc/httpd/conf.d/sparc-request.conf and change the RackEnv
<VirtualHost *:80>
ServerName obis-sparc-dev.mdc.musc.edu
DocumentRoot /var/www/rails/sparc-rails/current/public
Expand All @@ -37,40 +30,8 @@ Assumptions/Directions:

* your public key has been added to the capistrano users .ssh/authorized_keys file

* capistrano user has sudo rights, needed to update/install rvm

* after cap deploy:setup you must manually create shared/config/database.yml and shared/config/setup_load_paths.rb
example database.yml

testing:
adapter: mysql2
database: sparc_rails_testing
username: root
password: password

example setup_load_paths.rb

if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
gems_path = ENV['MY_RUBY_HOME'].split(/@/)[0].sub(/rubies/,'gems')
ENV['GEM_PATH'] = "#{gems_path}:#{gems_path}@global"
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
rescue LoadError
raise "RVM gem is currently unavailable."
end
end

# If you're not using Bundler at all, remove lines bellow
ENV['BUNDLE_GEMFILE'] = File.expand_path('../DeployGemfile', File.dirname(__FILE__))
require 'bundler/setup'
* cap deploy:check and then create any files it needs to the shared folder

* capistrano user has rights to clone the obis-bridge and sparc-rails repos from github, make sure the capistrano users key is added as key for a user that rights to the repos
* capistrano user has rights to clone the sparc-request repo from github, make sure the capistrano users key is added as key for a user that rights to the repos

* to update obis-bridge
- bump the version number in lib/obis-bridge/version.rb (not really necessary)
- rm DeployGemfile.lock
- bundle install --gemfile DeployGemfile
- git add DeployGemfile*
- commit and push
- cap deploy
* cap deploy