aboutsummaryrefslogtreecommitdiff
path: root/app/jobs
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-04-03 08:04:22 +0100
committerChristopher Baines <mail@cbaines.net>2018-04-12 08:30:03 +0100
commitbb42b5dac2f5cf76bea57137b248efbd177bc6ed (patch)
tree74b0eaf70d776a6722539cf352de198a837a7063 /app/jobs
parent39d3f763d3644ac8f6f7274edb11fd1dff1c1ba9 (diff)
downloadgovuk-mini-environment-admin-bb42b5dac2f5cf76bea57137b248efbd177bc6ed.tar
govuk-mini-environment-admin-bb42b5dac2f5cf76bea57137b248efbd177bc6ed.tar.gz
License under the AGPLv3+
Diffstat (limited to 'app/jobs')
-rw-r--r--app/jobs/destroy_job.rb20
-rw-r--r--app/jobs/enqueued_jobs.rb20
-rw-r--r--app/jobs/govuk_guix/build_job.rb20
-rw-r--r--app/jobs/govuk_guix/fetch_revision_job.rb20
-rw-r--r--app/jobs/govuk_guix/job.rb20
-rw-r--r--app/jobs/mini_environment_job.rb20
-rw-r--r--app/jobs/start_job.rb20
7 files changed, 140 insertions, 0 deletions
diff --git a/app/jobs/destroy_job.rb b/app/jobs/destroy_job.rb
index 4104b1a..a57d530 100644
--- a/app/jobs/destroy_job.rb
+++ b/app/jobs/destroy_job.rb
@@ -1,3 +1,23 @@
+# GOV.UK Mini Environment Admin
+# Copyright © 2018 Christopher Baines <mail@cbaines.net>
+#
+# This file is part of the GOV.UK Mini Environment Admin.
+#
+# The GOV.UK Mini Environment Admin is free software: you can
+# redistribute it and/or modify it under the terms of the GNU Affero
+# General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later
+# version.
+#
+# The GOV.UK Mini Environment Admin is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with the GOV.UK Mini Environment Admin. If not, see
+# <http://www.gnu.org/licenses/>.
+
class DestroyJob < MiniEnvironmentJob
@retry_interval = 30
diff --git a/app/jobs/enqueued_jobs.rb b/app/jobs/enqueued_jobs.rb
index 220899c..7372ceb 100644
--- a/app/jobs/enqueued_jobs.rb
+++ b/app/jobs/enqueued_jobs.rb
@@ -1,3 +1,23 @@
+# GOV.UK Mini Environment Admin
+# Copyright © 2018 Christopher Baines <mail@cbaines.net>
+#
+# This file is part of the GOV.UK Mini Environment Admin.
+#
+# The GOV.UK Mini Environment Admin is free software: you can
+# redistribute it and/or modify it under the terms of the GNU Affero
+# General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later
+# version.
+#
+# The GOV.UK Mini Environment Admin is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with the GOV.UK Mini Environment Admin. If not, see
+# <http://www.gnu.org/licenses/>.
+
module EnqueuedJobs
def enqueued_jobs(argument = nil)
condition = argument ? " AND args->>0 = '#{argument}'" : ''
diff --git a/app/jobs/govuk_guix/build_job.rb b/app/jobs/govuk_guix/build_job.rb
index d09fc68..eb3794e 100644
--- a/app/jobs/govuk_guix/build_job.rb
+++ b/app/jobs/govuk_guix/build_job.rb
@@ -1,3 +1,23 @@
+# GOV.UK Mini Environment Admin
+# Copyright © 2018 Christopher Baines <mail@cbaines.net>
+#
+# This file is part of the GOV.UK Mini Environment Admin.
+#
+# The GOV.UK Mini Environment Admin is free software: you can
+# redistribute it and/or modify it under the terms of the GNU Affero
+# General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later
+# version.
+#
+# The GOV.UK Mini Environment Admin is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with the GOV.UK Mini Environment Admin. If not, see
+# <http://www.gnu.org/licenses/>.
+
class GovukGuix::BuildJob < GovukGuix::Job
DEFAULT_ARGUMENTS = {
'rails-environment' => 'production',
diff --git a/app/jobs/govuk_guix/fetch_revision_job.rb b/app/jobs/govuk_guix/fetch_revision_job.rb
index 19ae78c..76e16bd 100644
--- a/app/jobs/govuk_guix/fetch_revision_job.rb
+++ b/app/jobs/govuk_guix/fetch_revision_job.rb
@@ -1,3 +1,23 @@
+# GOV.UK Mini Environment Admin
+# Copyright © 2018 Christopher Baines <mail@cbaines.net>
+#
+# This file is part of the GOV.UK Mini Environment Admin.
+#
+# The GOV.UK Mini Environment Admin is free software: you can
+# redistribute it and/or modify it under the terms of the GNU Affero
+# General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later
+# version.
+#
+# The GOV.UK Mini Environment Admin is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with the GOV.UK Mini Environment Admin. If not, see
+# <http://www.gnu.org/licenses/>.
+
require 'git'
class GovukGuix::FetchRevisionJob < GovukGuix::Job
diff --git a/app/jobs/govuk_guix/job.rb b/app/jobs/govuk_guix/job.rb
index 577ead9..c20b9de 100644
--- a/app/jobs/govuk_guix/job.rb
+++ b/app/jobs/govuk_guix/job.rb
@@ -1,3 +1,23 @@
+# GOV.UK Mini Environment Admin
+# Copyright © 2018 Christopher Baines <mail@cbaines.net>
+#
+# This file is part of the GOV.UK Mini Environment Admin.
+#
+# The GOV.UK Mini Environment Admin is free software: you can
+# redistribute it and/or modify it under the terms of the GNU Affero
+# General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later
+# version.
+#
+# The GOV.UK Mini Environment Admin is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with the GOV.UK Mini Environment Admin. If not, see
+# <http://www.gnu.org/licenses/>.
+
require 'open3'
class GovukGuix::Job < Que::Job
diff --git a/app/jobs/mini_environment_job.rb b/app/jobs/mini_environment_job.rb
index c18e69a..6ee6c3e 100644
--- a/app/jobs/mini_environment_job.rb
+++ b/app/jobs/mini_environment_job.rb
@@ -1,3 +1,23 @@
+# GOV.UK Mini Environment Admin
+# Copyright © 2018 Christopher Baines <mail@cbaines.net>
+#
+# This file is part of the GOV.UK Mini Environment Admin.
+#
+# The GOV.UK Mini Environment Admin is free software: you can
+# redistribute it and/or modify it under the terms of the GNU Affero
+# General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later
+# version.
+#
+# The GOV.UK Mini Environment Admin is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with the GOV.UK Mini Environment Admin. If not, see
+# <http://www.gnu.org/licenses/>.
+
class MiniEnvironmentJob < Que::Job
def run(mini_environment_id, action)
ActiveRecord::Base.transaction do
diff --git a/app/jobs/start_job.rb b/app/jobs/start_job.rb
index 9d1c4ca..3616814 100644
--- a/app/jobs/start_job.rb
+++ b/app/jobs/start_job.rb
@@ -1,3 +1,23 @@
+# GOV.UK Mini Environment Admin
+# Copyright © 2018 Christopher Baines <mail@cbaines.net>
+#
+# This file is part of the GOV.UK Mini Environment Admin.
+#
+# The GOV.UK Mini Environment Admin is free software: you can
+# redistribute it and/or modify it under the terms of the GNU Affero
+# General Public License as published by the Free Software Foundation,
+# either version 3 of the License, or (at your option) any later
+# version.
+#
+# The GOV.UK Mini Environment Admin is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public
+# License along with the GOV.UK Mini Environment Admin. If not, see
+# <http://www.gnu.org/licenses/>.
+
class StartJob < MiniEnvironmentJob
@retry_interval = 30