Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
environments: do not migrate by default
Browse files Browse the repository at this point in the history
The migration part is now expected to be done by the administrator. This
is done automatically by the init script in containerized deployments.

This was done because now we had at least two portus processes accessing
the DB and trying to migrate the DB, which caused quite some issues.
Moreover, notice that the previous workflow (e.g. automatically
migrating on production) was simply not possible in orchestration
solutions like Docker Swarm or Kubernetes.

Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed Jan 12, 2018
1 parent 5e1932c commit 1c4d2b6
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 21 deletions.
14 changes: 0 additions & 14 deletions config/environments/helpers/migrate.rb

This file was deleted.

4 changes: 0 additions & 4 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,4 @@

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# Run pending migrations
require_relative "helpers/migrate"
run_migration!(config)
end
3 changes: 1 addition & 2 deletions packaging/suse/portus.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ bundle install --retry=3 --local --deployment --without assets test development
gem.ruby2.4 install --no-rdoc --no-ri --install-dir vendor/bundle/ruby/%{rb_ver}/ vendor/cache/bundler-*.gem

# Compile assets
SKIP_MIGRATION="yes" \
PORTUS_SECRET_KEY_BASE="ap" PORTUS_KEY_PATH="ap" PORTUS_PASSWORD="ap" \
PORTUS_SECRET_KEY_BASE="ap" PORTUS_KEY_PATH="ap" PORTUS_PASSWORD="ap" \
RAILS_ENV=production NODE_ENV=production \
bundle exec rake portus:assets:compile

Expand Down
1 change: 0 additions & 1 deletion packaging/suse/portusctl/lib/configurator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def create_database
Runner.activate_service("mysql") if database_local?

env_variables = {
"SKIP_MIGRATION" => "yes",
"PORTUS_PASSWORD" => @portus_password
}
puts "Creating Portus' database"
Expand Down

0 comments on commit 1c4d2b6

Please sign in to comment.