Welcome to mirror list, hosted at ThFree Co, Russian Federation.

scheduled.rb « build « status « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c6713f0d633a4df333e2fc91951953f297ca91a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module Gitlab
  module Ci
    module Status
      module Build
        class Scheduled < Status::Extended
          def illustration
            {
              image: 'illustrations/scheduled-job_countdown.svg',
              size: 'svg-394',
              title: _("This is a scheduled to run in ") + " #{execute_in}",
              content: _("This job will automatically run after it's timer finishes. Often they are used for incremental roll-out deploys to production environments. When unscheduled it converts into a manual action.")
            }
          end

          def status_tooltip
            "scheduled manual action (#{execute_in})"
          end

          def self.matches?(build, user)
            build.scheduled?
          end

          private

          def execute_in
            diff = [0, subject.scheduled_at - Time.now].max
            Time.at(diff).utc.strftime("%H:%M:%S")
          end
        end
      end
    end
  end
end