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

Commit 1c4d2b6

Browse files
committed
environments: do not migrate by default
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à <msabate@suse.com>
1 parent 5e1932c commit 1c4d2b6

File tree

4 files changed

+1
-21
lines changed

4 files changed

+1
-21
lines changed

Diff for: config/environments/helpers/migrate.rb

-14
This file was deleted.

Diff for: config/environments/production.rb

-4
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,4 @@
8484

8585
# Do not dump schema after migrations.
8686
config.active_record.dump_schema_after_migration = false
87-
88-
# Run pending migrations
89-
require_relative "helpers/migrate"
90-
run_migration!(config)
9187
end

Diff for: packaging/suse/portus.spec.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ bundle install --retry=3 --local --deployment --without assets test development
9595
gem.ruby2.4 install --no-rdoc --no-ri --install-dir vendor/bundle/ruby/%{rb_ver}/ vendor/cache/bundler-*.gem
9696

9797
# Compile assets
98-
SKIP_MIGRATION="yes" \
99-
PORTUS_SECRET_KEY_BASE="ap" PORTUS_KEY_PATH="ap" PORTUS_PASSWORD="ap" \
98+
PORTUS_SECRET_KEY_BASE="ap" PORTUS_KEY_PATH="ap" PORTUS_PASSWORD="ap" \
10099
RAILS_ENV=production NODE_ENV=production \
101100
bundle exec rake portus:assets:compile
102101

Diff for: packaging/suse/portusctl/lib/configurator.rb

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def create_database
116116
Runner.activate_service("mysql") if database_local?
117117

118118
env_variables = {
119-
"SKIP_MIGRATION" => "yes",
120119
"PORTUS_PASSWORD" => @portus_password
121120
}
122121
puts "Creating Portus' database"

0 commit comments

Comments
 (0)