From 098c1982713f3a4075efd6f27ab6326c75fc20ea Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 21 Sep 2015 00:14:07 +0200 Subject: Disable CI for time of migration --- lib/tasks/ci/migrate.rake | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib') diff --git a/lib/tasks/ci/migrate.rake b/lib/tasks/ci/migrate.rake index 3507871fcb0..1de664c85e1 100644 --- a/lib/tasks/ci/migrate.rake +++ b/lib/tasks/ci/migrate.rake @@ -10,6 +10,10 @@ namespace :ci do puts '' end + # disable CI for time of migration + enable_ci(false) + + # unpack archives migrate = Ci::Migrate::Manager.new migrate.unpack @@ -18,6 +22,9 @@ namespace :ci do Rake::Task['ci:migrate:tags'].invoke Rake::Task['ci:migrate:services'].invoke + # enable CI for time of migration + enable_ci(true) + migrate.cleanup end @@ -71,4 +78,10 @@ namespace :ci do $progress.puts 'done'.green end end + + def enable_ci(enabled) + settings = ApplicationSetting.current || ApplicationSetting.create_from_defaults + settings.ci_enabled = enabled + settings.save! + end end -- cgit v1.2.1