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

Integrate with make_osc & deploy on osm-database #541

Merged
merged 2 commits into from
May 22, 2017
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
4 changes: 2 additions & 2 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Default value for :linked_files is []
set :linked_files, %w{ config/database.yml config/open_street_map.yml config/metrics.yml config/librato.yml config/newrelic.yml .env config/secrets.yml}

set :bundle_roles, [:app, :worker]
set :bundle_roles, [:app, :worker, :importer]
set :bundle_without, %w{ development test metrics deployment }.join(' ')
set :bundle_jobs, 4
set :bundle_binstubs, -> { shared_path.join('bin') }
Expand Down Expand Up @@ -75,7 +75,7 @@

# We need to link the existing shared `/var/apps/wheelmap/public/system` folder
# into the new release.
execute :ln, "-s", "#{deploy_path}/public/system", "#{release_path}/public/"
execute :ln, "-s", "#{deploy_path}/public/system/uploads", "#{release_path}/public/system"

# We create this file so the consul health check will pass. We can't use an
# existing file since they are all unpredictably named.
Expand Down
1 change: 1 addition & 0 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
server 'app1.node.production', user: 'deploy', roles: %w{app}, port: 22
server 'asset.node.production', user: 'deploy', roles: %w{asset}, port: 22, :no_release => true
server 'worker0.node.production', user: 'deploy', roles: %w{worker}, port: 22
server 'osm-database.node.production', user: 'deploy', roles: %w{importer}, port: 22 # Used for replication.
#server 'mysql.node.production', user: 'wheelmap', roles: %w{mysql}, port: 22

# Custom SSH Options
Expand Down
1 change: 1 addition & 0 deletions config/deploy/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
server 'app1.node.staging', user: 'deploy', roles: %w{app}, port: 22
server 'asset.node.staging', user: 'deploy', roles: %w{asset}, port: 22, :no_release => true
server 'worker0.node.staging', user: 'deploy', roles: %w{worker}, port: 22
server 'osm-database.node.staging', user: 'deploy', roles: %w{importer}, port: 22 # Used for replication.
#server 'mysql.node.production', user: 'wheelmap', roles: %w{mysql}, port: 22

# Custom SSH Options
Expand Down
6 changes: 3 additions & 3 deletions lib/tasks/planet_reader.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SHAPE_FILE = "#{VAR_DIR}/shapes.osc".freeze
STATE_FILE = "#{WORKING_DIR}/state.txt".freeze
BACKUP_FILE = "#{WORKING_DIR}/state.old".freeze
DOWNLOAD_LOCK = "#{WORKING_DIR}/download.lock".freeze
MAKE_OSC_DIR = "/var/apps/make_osc/".freeze

require 'rake'

Expand Down Expand Up @@ -54,9 +55,8 @@ def get_new_replication_file
end

def get_new_shape_replication_files
puts 'INFO: Fetching shape changes.'
system "ssh -p 22022 [email protected] \"ruby make_osc.rb -d\" 2> /dev/null >> #{SHAPE_FILE}"
puts "INFO: Downloaded #{File.size(SHAPE_FILE)} bytes"
puts "INFO: Fetching shape changes."
system "BUNDLE_GEMFILE=#{MAKE_OSC_DIR}/Gemfile bundle exec #{MAKE_OSC_DIR}/make_osc.rb -d >> #{SHAPE_FILE}"
end

def merge_replication_files
Expand Down