Skip to content

Commit

Permalink
Merge pull request #541 from sozialhelden/feature/infra-rebuild-syncing
Browse files Browse the repository at this point in the history
Integrate with make_osc & deploy on osm-database
  • Loading branch information
Andrew Hobden authored May 22, 2017
2 parents d1e9709 + c5bed48 commit 49ccec1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
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

0 comments on commit 49ccec1

Please sign in to comment.