Commit 3fc4c096 authored by Shinya Maeda's avatar Shinya Maeda Committed by Alessio Caiazza

Squashed commit of the following:

commit 9d9594ba20097dc4598f7eb42a9f9d78d73eae54
Author: Shinya Maeda <shinya@gitlab.com>
Date:   Thu Sep 13 20:18:31 2018 +0900

    Cancel scheduled jobs

commit f31c7172e07a9eb03b58c1e62eaa18cda4064aa6
Author: Shinya Maeda <shinya@gitlab.com>
Date:   Thu Sep 13 11:18:42 2018 +0900

    Add Ci::BuildSchedule

commit fb6b3ca638f40f9e1ee38b1fdd892bda4f6fede7
Author: Shinya Maeda <shinya@gitlab.com>
Date:   Wed Sep 12 20:02:50 2018 +0900

    Scheduled jobs
parent d5184e0d
......@@ -22,6 +22,7 @@ module Ci
}.freeze
has_one :last_deployment, -> { order('deployments.id DESC') }, as: :deployable, class_name: 'Deployment'
has_one :build_schedule, class_name: 'Ci::BuildSchedule', foreign_key: :build_id
has_many :trace_sections, class_name: 'Ci::BuildTraceSection'
has_many :trace_chunks, class_name: 'Ci::BuildTraceChunk', foreign_key: :build_id
......@@ -184,6 +185,12 @@ module Ci
end
end
after_transition any => [:manual] do |build|
build.run_after_commit do
build.schedule_delayed_execution
end
end
before_transition any => [:failed] do |build|
next unless build.project
next if build.retries_max.zero?
......@@ -229,6 +236,20 @@ module Ci
action? && (manual? || retryable?)
end
def autoplay?
manual? && options[:autoplay_in].present?
end
def autoplay_at
ChronicDuration.parse(options[:autoplay_in])&.seconds&.from_now
end
def schedule_delayed_execution
return unless autoplay?
create_build_schedule!(execute_at: autoplay_at)
end
def action?
self.when == 'manual'
end
......
# frozen_string_literal: true
module Ci
class BuildSchedule < ActiveRecord::Base
extend Gitlab::Ci::Model
include Importable
include AfterCommitQueue
belongs_to :build
after_create :schedule, unless: :importing?
def execute_in
self.execute_at - Time.now
end
private
def schedule
run_after_commit do
Ci::BuildScheduleWorker.perform_at(self.execute_at, self.build_id)
end
end
end
end
......@@ -92,7 +92,8 @@ module HasStatus
scope :failed_or_canceled, -> { where(status: [:failed, :canceled]) }
scope :cancelable, -> do
where(status: [:running, :pending, :created])
where("status IN ('running', 'pending', 'created') OR " \
"(status = 'manual' AND EXISTS (select 1 from ci_build_schedules where ci_builds.id = ci_build_schedules.build_id))")
end
end
......
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 452.62 428.54"><title>Anchor-with-border</title><path d="M360,219.84c-.79-1.48-1.65-2.92-2.51-4.36a23.88,23.88,0,0,0-1.71-2.6,1.72,1.72,0,0,0-1.25-.69c-.34.05-.69.68-.84,1.11a7.27,7.27,0,0,0-.23,1.77c-.22,3.18-.17,6.41-.69,9.55a30.79,30.79,0,0,0,1.14,14.65c.85,2.66,1.84,5.28,2.51,8,1.39,5.62,2.81,11.24,3.85,16.93.71,3.95.78,8,1.17,12,.13,1.32.34,2.62.51,3.93l.58.2a13.84,13.84,0,0,0,1.84-2,34.65,34.65,0,0,0,2-4c1.19-2.7,2.38-5.41,3.44-8.17a44.08,44.08,0,0,0,1.72-5.6c1.23-5.18.37-10.22-1.13-15.22A139.62,139.62,0,0,0,360,219.84Z"/><path d="M170.4,331.84c1.72-.22,3.46-.39,5.17-.67a26.86,26.86,0,0,0,4.42-1c1.27-.44,1.29-1.19.21-2a11.32,11.32,0,0,0-1.75-1c-2.92-1.38-5.89-2.65-8.75-4.13a33.81,33.81,0,0,0-12.46-3.85c-1.61-.15-3.25,0-4.88-.13-2.35-.13-4.71-.22-7-.53-4.94-.67-9.9-1.26-14.77-2.29-4.63-1-9.15-2.5-13.74-3.71a8.16,8.16,0,0,0-2.24,0,6.92,6.92,0,0,0,.84,2.13,67.2,67.2,0,0,0,5.5,5.83c2.94,2.65,5.5,5.78,9.13,7.6,1.85.92,3.61,2.24,5.56,2.7a80,80,0,0,0,12.53,1.83A113.22,113.22,0,0,0,170.4,331.84Z"/><path d="M96.63,144a104.6,104.6,0,0,0,2.11,17.66c1,4.94,2.38,9.83,3.62,14.73a8.36,8.36,0,0,0,.93,2.31c.44.71,1.1.85,1.56,0A19.49,19.49,0,0,0,106,176c1.12-3.32,2.12-6.69,3.31-10a30.33,30.33,0,0,0,1.87-11.4c-.1-2.74-.48-5.47-.51-8.21-.06-5.71-.2-11.43.14-17.12.27-4.51,1.21-9,1.84-13.46a35.64,35.64,0,0,0,.41-3.68c0-1-.49-1.24-1.3-.69A8.47,8.47,0,0,0,110,113q-2.28,2.7-4.43,5.49c-3.1,4-6.07,8.08-7.76,13A24.94,24.94,0,0,0,96.63,141C96.63,142.24,96.6,143.12,96.63,144Z"/><path d="M267.84,75.3c-4.73,1.29-9.43,2.74-14.05,4.39-3.12,1.12-6.08,2.69-9.09,4.1-.34.16-.82.64-.77.88a2.07,2.07,0,0,0,.86,1,2.37,2.37,0,0,0,1,.34c1.61.25,3.24.39,4.83.72,4.09.85,8,2.19,12.31,2.32a38.91,38.91,0,0,0,10.24-.9c2.3-.54,4.62-1,6.95-1.43a47,47,0,0,1,4.75-.45c5.22-.34,10.43-.75,15.66-.93,2.94-.1,5.9.2,8.73.32a18.63,18.63,0,0,0,2.16,0c.88-.11,1.15-.75.59-1.45a6.8,6.8,0,0,0-1.46-1.41,55,55,0,0,0-4.69-3c-3.6-2-7.18-4-10.93-5.65a21.78,21.78,0,0,0-11.35-1.79c-1.86.22-3.72.5-5.56.85C274.62,73.84,271.18,74.38,267.84,75.3Z"/><path d="M197.19,74.67a.56.56,0,0,0-.08.09c-.94,1-1.91,1.92-2.81,2.93-3.4,3.81-6.81,7.61-10.13,11.49a7.15,7.15,0,0,0-.84,2.34,10.12,10.12,0,0,0,2.6,0c3-.76,5.89-1.77,8.88-2.49a36.2,36.2,0,0,0,14.25-6.64c2-1.58,3.92-3.32,6-4.82,3.3-2.39,6.58-4.84,10.07-6.91,4.63-2.75,9.46-5.16,14.21-7.71,1.27-.68,2.56-1.33,3.83-2,.29-.15.79-.39.78-.55a1.49,1.49,0,0,0-.53-1.08,6.26,6.26,0,0,0-2.17-.61c-4.34-.33-8.69-.59-11.76-.79-7.82.08-13.82,1.8-19.08,5.82-2.28,1.74-4.53,3.53-6.83,5.26S199.57,73.09,197.19,74.67Z"/><path d="M379.43,196.41c-.33-3.08-.42-6.2-1.58-9.17-1.26-3.26-2.5-6.49-4.9-9.12-1.07-1.17-2.21-2.29-3.36-3.39-3.58-3.42-7.14-6.85-10.78-10.19a39.3,39.3,0,0,0-3.92-2.92c-3.32-2.36-6.64-4.71-10-7a15.34,15.34,0,0,0-2.71-1.52,5.24,5.24,0,0,0-1.7-.12,5.13,5.13,0,0,0,0,1.71c.39,1.2.94,2.36,1.45,3.53,1.15,2.67,2.44,5.29,3.45,8a31.21,31.21,0,0,0,7.38,11.15c3.33,3.37,6.72,6.69,9.91,10.19a112.78,112.78,0,0,1,12.72,17.23c.86,1.39,1.71,2.79,2.67,4.12.68.94,1.4.82,1.66-.3a24.16,24.16,0,0,0,.36-3.2C379.85,202.23,379.75,199.31,379.43,196.41Z"/><path d="M240,339.32a7.58,7.58,0,0,0,1.31-2.26,8.56,8.56,0,0,0-2.34-.6c-4.51.15-9,.39-13.52.64a30.11,30.11,0,0,0-12.08,3.28c-1.66.84-3.26,1.83-5,2.6s-3.39,1.25-5.08,1.92c-1.48.58-2.9,1.36-4.41,1.84-2.83.9-5.71,1.69-8.58,2.45-2.7.72-5.42,1.37-8.15,2-1.91.45-3.85.83-5.77,1.24a8.26,8.26,0,0,0-.94.15c-.77.26-.94.94-.3,1.44a7.87,7.87,0,0,0,2.06,1.2c1.76.65,3.54,1.25,5.34,1.75,3.5,1,7,2,10.54,2.74a49.28,49.28,0,0,0,7,.4,36.39,36.39,0,0,0,5.64-1.31c4.07-1.6,8.1-3.33,12-5.27A117.38,117.38,0,0,0,240,339.32Z"/><path d="M136.27,107.74c-.86,2.78-1.57,5.61-2.27,8.44-.63,2.6-1.15,5.22-1.75,8,.22.47.33,1.18.73,1.42s1-.19,1.45-.45a8.14,8.14,0,0,0,1.36-1.17c2.35-2.27,4.72-4.52,7-6.83a54.53,54.53,0,0,0,4.76-5.05,32.69,32.69,0,0,0,3.49-5.68c2-4.13,3.77-8.39,5.77-12.53a68.73,68.73,0,0,1,4.1-7.38c2.62-4.06,5.4-8,8.15-12,.82-1.18,1.82-2.24,2.61-3.43a4.34,4.34,0,0,0,.27-1.69,3.88,3.88,0,0,0-1.42-.14,33.84,33.84,0,0,0-4.48,1.57c-3.22,1.49-6.36,3.15-9.58,4.64-3,1.39-5.32,3.65-7.74,5.8-3.07,2.74-4.38,6.58-6.18,10.09a77.39,77.39,0,0,0-3.24,7.59C138.23,101.83,137.19,104.77,136.27,107.74Z"/><path d="M324.51,109.34c-2.42-.58-4.88-1-7.34-1.38-4.57-.7-9.15-1.31-13.73-2l0,.23a1.43,1.43,0,0,0-.36,0l-2.54.7a11.13,11.13,0,0,0,1.57,2.21c2.61,2.24,5.36,4.33,8,6.58a32.32,32.32,0,0,0,13.28,7.36c1.66.41,3.35.72,5,1.24,2.2.71,4.39,1.47,6.51,2.39,5,2.17,10,4.39,15,6.7,2,1,4,2.18,5.91,3.3,1.25.71,2.44,1.53,3.72,2.17a4.51,4.51,0,0,0,1.68.12,4.78,4.78,0,0,0,0-1.69,21.42,21.42,0,0,0-1.77-3.5c-3-4.57-5.44-9.44-9.35-13.39a25.89,25.89,0,0,0-8.5-6,78.25,78.25,0,0,0-7.6-2.5C330.74,111,327.64,110.09,324.51,109.34Z"/><path d="M111.44,287.41c2.49,1.21,5,2.39,7.53,3.51,1.16.51,2.41.83,3.61,1.24,2.18.73,4.34,1.53,6.55,2.15a6.15,6.15,0,0,0,2.18-.22,8.36,8.36,0,0,0-.78-2.13c-1.37-1.91-2.89-3.72-4.3-5.6s-2.61-3.83-4.11-5.59a46.67,46.67,0,0,0-4.85-4.83,28.81,28.81,0,0,0-3.85-2.58c-1.1-.68-2.26-1.29-3.39-1.93a107.63,107.63,0,0,1-14.69-10.05c-2.48-2-5-4-7.34-6.16s-4.89-4.64-7.32-7l-.52.1c-.13.45-.44.92-.37,1.33a46.07,46.07,0,0,0,1.1,5.12c.61,2.09,1.53,4.1,2.09,6.2a31.55,31.55,0,0,0,3.91,9.08,23,23,0,0,0,5.84,6.75c2.91,2,5.9,4,9,5.69S108.18,285.82,111.44,287.41Z"/><path d="M75.58,200.93a45.89,45.89,0,0,0,2,5.94c1.52,3.07,3.28,6,5.07,9a77.62,77.62,0,0,0,4.49,6.64c2.55,3.35,5.21,6.61,7.9,9.86,1.46,1.76,3,3.43,4.6,5.08a20.43,20.43,0,0,0,2.68,2.35c1,.73,1.67.4,1.61-.86a36.89,36.89,0,0,0-.61-4c-.38-2.39-.88-4.77-1.1-7.17a30,30,0,0,0-2.41-9.7c-1.15-2.55-2.71-4.91-4.11-7.34s-3-4.87-4.31-7.37-2.66-5.13-3.83-7.77q-2.38-5.4-4.49-10.92c-.88-2.3-1.48-4.71-2.31-7A6.81,6.81,0,0,0,79.55,176c-.43.49-1.05.91-1.24,1.48a29,29,0,0,0-1.09,4.4c-.55,3.33-1.1,6.67-1.44,10-.25,2.4-.19,4.83-.21,7.25a7.55,7.55,0,0,0,.39,1.71Z"/><path d="M268.49,335c1-1.15,1.78-2.45,2.64-3.69.42-.6.25-1.18-.43-1.3a5,5,0,0,0-2.17.1c-3.42,1-6.8,2.09-10.24,3a34.66,34.66,0,0,0-9.36,3.85c-1,.61-1.95,1.36-2.93,2-1.19.81-2.31,1.72-3.43,2.65-1.45,1.22-2.88,2.47-4.39,3.6a96.19,96.19,0,0,1-9,6c-2.86,1.67-5.74,3.33-8.68,4.86s-6.16,3-9.22,4.5a1.73,1.73,0,0,0-.74,1.11c0,.19.46.61.78.74a7.2,7.2,0,0,0,1.85.44c2.3.23,4.61.55,6.92.6a86.65,86.65,0,0,0,10.41-.17,34.5,34.5,0,0,0,7.82-1.89c3.33-1.16,5.61-3.38,8.32-5.48s5.31-4.09,7.87-6.29A129.19,129.19,0,0,0,268.49,335Z"/><path d="M226.12,74.23C224,75.5,222,77,219.92,78.5c-1,.68-1.81,1.51-2.77,2.2s-1.94,1.09-2.76,1.81a8.22,8.22,0,0,0-1.26,1.93c.66.24,1.32.49,2,.7a2.14,2.14,0,0,0,.71.06c4.19-.15,8.38-.28,12.57-.46a23.47,23.47,0,0,0,3.81-.39c6-1.27,11.41-4.43,17.08-6.69,3.33-1.33,6.66-2.65,10-3.86a37.81,37.81,0,0,1,4.4-1.09L275.47,70a32.19,32.19,0,0,0,3.38-.79c1.23-.42,1.31-1.13.22-1.84a9,9,0,0,0-1.84-.69c-2.29-.84-4.53-1.82-6.86-2.48-3.06-.86-6.17-1.56-9.29-2.17-7.95-1.57-16.07,1.81-22.92,5.49C234.11,69.72,230.08,71.9,226.12,74.23Z"/><path d="M84,176c1,3.53,2.36,7,3.65,10.42,1.07,2.81,2.2,5.61,3.44,8.35,1.11,2.47,2.32,4.9,3.62,7.28s2.73,4.59,4.17,6.84c.24.37.89.79,1.21.7a1.64,1.64,0,0,0,.83-1.17c.21-1.26.27-2.54.37-3.81.14-1.86.22-3.74.41-5.6.35-3.33.93-6.67.33-10a71,71,0,0,0-1.64-7.89c-.86-2.82-2.21-5.41-2.91-8.33-.81-3.4-1.64-6.81-2.25-10.26-.74-4.16-1.33-8.35-1.86-12.54-.26-2.05-.18-4.15-.39-6.21a9.19,9.19,0,0,0-.83-2.22c-.63.55-1.46,1-1.84,1.68-1.07,1.93-2,3.94-2.89,6-1,2.26-2,4.54-2.85,6.86a31,31,0,0,0-2.13,10.81,25,25,0,0,0,.63,5.51C83.35,173.58,83.66,174.79,84,176Z"/><path d="M87.73,250a113.13,113.13,0,0,0,15.08,12.54c2.21,1.51,4.4,3.06,6.65,4.52a25.55,25.55,0,0,0,3.48,1.87c.86.39,1.58-.06,1.41-.77a15,15,0,0,0-.82-2.58c-.51-1.19-1.18-2.32-1.7-3.52-1.53-3.53-2.86-7.17-4.58-10.6a30.94,30.94,0,0,0-7.33-9.1,92.22,92.22,0,0,1-8.67-8.93,78.49,78.49,0,0,1-5.52-6.9C82.78,222.3,80,218,77.18,213.67a5.74,5.74,0,0,0-1-1.18c-.58-.5-1.07-.31-1.23.42a13.17,13.17,0,0,0-.38,2.7c0,1.92.08,3.84.24,5.75.43,5.09.68,10.19,2.62,15a34,34,0,0,0,6.9,10.12C85.46,247.74,86.61,248.89,87.73,250Z"/><path d="M290.38,333.8c.95-1.42,1.56-3.07,2.5-4.49.81-1.22,1.23-2.59,2-3.84a40.63,40.63,0,0,0,2.21-4.1c.37-.75,2.46-4.68,1-5a2.9,2.9,0,0,0-1.83.21,81.71,81.71,0,0,0-10.12,6.79c-1.63,1.22-3.61,1.41-5.25,2.56-3.11,2.19-5,5.48-7.4,8.34-3.48,4.17-7,8.32-10.65,12.31a116.71,116.71,0,0,1-14.61,12.93,4.4,4.4,0,0,0-1.12,1.22c-.11.2.13.87.3.91a7.61,7.61,0,0,0,2.68.31c3.15-.5,6.27-1.19,9.41-1.71A36.47,36.47,0,0,0,272,355.89c4.83-2.8,8.32-7.64,11.47-12.13C285.78,340.45,288.14,337.16,290.38,333.8Z"/><path d="M339.29,271.2a1.8,1.8,0,0,0-1.37.68,20.49,20.49,0,0,0-1.54,2.35c-2.13,3.37-4.36,6.68-6.33,10.15a42.58,42.58,0,0,0-3,6.84,33.85,33.85,0,0,0-1.1,5.12c-.48,2.58-.85,5.18-1.39,7.74-.47,2.25-1.12,4.47-1.68,6.7a32.8,32.8,0,0,1-1.89,6.28,66.17,66.17,0,0,0-2.56,6.53c-1.11,3.16-2.24,6.24-3.6,9.3a5.72,5.72,0,0,0-.4,1.13c-.16.78.21,1.17,1,1.06a3.35,3.35,0,0,0,1.33-.47c1.18-.78,2.35-1.59,3.46-2.47,2.36-1.85,4.69-3.75,7-5.65a43.8,43.8,0,0,0,6.24-6.61c.42-.52.82-1.06,1.19-1.62,1.82-2.77,2.3-5.9,2.86-9.08.69-3.92,1.47-7.82,2-11.76a69.28,69.28,0,0,0,.81-8.94c.07-5.35-.1-10.7-.24-16A1.6,1.6,0,0,0,339.29,271.2Z"/><path d="M357.9,277.22c-.33-3.25-.65-6.49-1-9.73s-.69-6.27-1.32-9.35c-.8-3.86-1.88-7.67-2.88-11.49a19.74,19.74,0,0,0-1-3.05,1.68,1.68,0,0,0-1.09-.88c-.33,0-.84.35-1.09.69a5.38,5.38,0,0,0-.68,1.52c-1.25,3.81-2.42,7.66-3.75,11.44a30,30,0,0,0-1.64,8.62,58.37,58.37,0,0,0,.43,6.66c.16,2.28.28,4.63.28,6.92,0,3.48,0,7-.22,10.43-.24,3.94-.65,7.88-1.12,11.8-.32,2.68-.85,5.34-1.32,8.24l.45,1.43c.6-.26,1.21-.51,1.8-.78.1,0,.16-.17.24-.26a82.06,82.06,0,0,0,10.58-14.15A28.14,28.14,0,0,0,358,279.12Q358,278.17,357.9,277.22Z"/><path d="M178.34,348c1.61-.28,3.23-.55,4.83-.92,3.41-.8,6.83-1.58,10.2-2.55,2.22-.63,4.36-1.54,6.52-2.37,3-1.16,6-2.3,9-3.58.71-.31,1.19-1.14,1.78-1.72a8.61,8.61,0,0,0-2.18-1.21c-3.08-.67-6.21-1.07-9.27-1.8-4.42-1.06-8.86-1.78-13.39-1.09-1.79.27-3.42,1-5.21,1.24s-3.61.43-5.4.76-3.44.7-5.18.89c-2.06.22-4.14.32-6.21.36-4.59.09-9.18.15-13.77.15-2.16,0-4.31-.21-6.47-.22a2,2,0,0,0-1.34.77c-.12.15.29.81.56,1.17a3.2,3.2,0,0,0,.89.79c2.87,1.8,5.72,3.66,8.66,5.34a45,45,0,0,0,7.27,3.64c3.89,1.37,9,2.74,13.15,1.55A51.64,51.64,0,0,1,178.34,348Z"/><path d="M376.75,214.15a69.55,69.55,0,0,0-5.08-8.58c-1.29-2-2.55-4.06-4-6-2.69-3.53-5.44-7-8.29-10.42-1.84-2.2-3.86-4.25-5.91-6.26a9.48,9.48,0,0,0-2.41-1.28,9.8,9.8,0,0,0-.41,2.72q.62,4.61,1.54,9.19c.57,2.84,1.31,5.65,2,8.47a18.76,18.76,0,0,0,2.62,5.9c1.37,2.13,2.68,4.06,3.87,6.25,1.37,2.53,2.85,5,4.16,7.56,1.49,2.91,2.79,5.92,4.07,8.94,1.09,2.57,2,5.21,3,7.81.33.85.74,1.67,1,2.53.44,1.26.75,2.56,1.25,3.79a1.69,1.69,0,0,0,1.11.76c.18,0,.58-.48.74-.81a7.86,7.86,0,0,0,.73-2c.81-5,1.82-9.89,2.26-14.88a36.37,36.37,0,0,0-.75-8.73A19.4,19.4,0,0,0,376.75,214.15Z"/><path d="M355.55,140.78a106,106,0,0,0-15.49-8q-6.59-2.53-13.19-5a10.89,10.89,0,0,0-2.42-.65c-1.11-.14-1.6.55-1.07,1.53a19.41,19.41,0,0,0,1.72,2.53c.95,1.23,2,2.36,2.92,3.64,2.38,3.42,4.63,7,7.85,9.68a45.94,45.94,0,0,0,4.62,3.28c1.4.91,3,1.45,4.33,2.44,1.53,1.12,3.14,2.17,4.76,3.21a119.06,119.06,0,0,1,18.59,14.62c1.63,1.58,3.27,3.16,4.95,4.7a1.39,1.39,0,0,0,1.15.37c.26-.11.47-.72.44-1.1a15.3,15.3,0,0,0-.46-3.3c-.81-2.74-1.66-5.48-2.67-8.15a71.87,71.87,0,0,0-3.37-7.89c-2.48-4.78-6.47-8.06-10.91-10.84Q356.44,141.3,355.55,140.78Z"/><path d="M304.73,89.09a101.26,101.26,0,0,0-18.55.49c-3.88.42-7.71,1.28-11.55,2a1.5,1.5,0,0,0-1,.81c-.09.26.27.84.59,1a24.08,24.08,0,0,0,2.74,1.46c2.63,1.24,5.35,2.32,7.91,3.7,9,4.83,19,3.76,28.8,5.16,4.19.6,8.4,1.26,12.52,2.22s8.12,2.32,12.19,3.45a4.43,4.43,0,0,0,1.55-.15,4.28,4.28,0,0,0-.36-1.53,22.24,22.24,0,0,0-2.74-3.35c-3.69-3.45-7.29-7-11.27-10.15-4.28-3.34-9.19-4.24-14.27-4.68C309.1,89.36,306.92,89.26,304.73,89.09Z"/><path d="M129,312.23a118.55,118.55,0,0,0,20.09,3.11,30.71,30.71,0,0,0,3.83,0c1.17-.07,1.43-.76.7-1.69A4.4,4.4,0,0,0,153,313c-1.77-1.46-3.52-2.94-5.33-4.34-3.06-2.35-6.13-4.68-9.26-6.95-4.24-3.07-10.09-3.74-15-5.4-.74-.25-1.57-.29-2.29-.6-4.6-2-9.24-3.94-13.76-6.12-3.55-1.72-6.95-3.75-10.4-5.67-1.11-.61-2.15-1.39-3.81-1a12.58,12.58,0,0,0,.78,2.55c1.3,2.34,2.74,4.59,4.07,6.9,2.87,5,6.25,9.6,11.12,12.81a35.76,35.76,0,0,0,7.77,3.72C120.92,310.31,125.15,311.28,129,312.23Z"/><path d="M161.89,91.92c-1.1,1.83-1.86,3.85-2.8,5.78-1.06,2.17-2.16,4.31-3.19,6.49a1.32,1.32,0,0,0,.11,1.19,1.53,1.53,0,0,0,1.19.24,3.71,3.71,0,0,0,1.3-.58c1.48-.93,2.89-2,4.42-2.82a73.73,73.73,0,0,0,10.61-6.43,33.32,33.32,0,0,0,5.8-6.47c.82-1.09,1.71-2,2.6-3s1.56-2.51,2.73-3.5a38.73,38.73,0,0,0,3.49-3.91,113.56,113.56,0,0,1,13.76-13.16c.54-.43.89-1.11,1.44-1.52,1-.74,2.1-1.3,3-2.08a8.47,8.47,0,0,0,1.29-1.77l-.25-.47a25.3,25.3,0,0,0-3.14-.12,25.83,25.83,0,0,0-3.28.61c-4.21.9-8.48,1.57-12.6,2.76-9.29,2.7-15.1,11.4-20.21,18.95C166,85.33,163.89,88.58,161.89,91.92Z"/><path d="M114.43,149.25a1.85,1.85,0,0,0,.92,1.33c.29.12,1-.38,1.3-.77a24.72,24.72,0,0,0,2.11-3.26c2.47-4.68,6.12-8.64,7.95-13.75.86-2.4,1.47-4.92,2.17-7.35s.53-5.3,1.11-7.74c.62-2.63,1.29-5.24,2-7.85a124.36,124.36,0,0,1,6.46-18.14c.55-1.27,1.13-2.55,1.58-3.86.34-1-.08-1.4-1.08-1.12a6.22,6.22,0,0,0-2,1c-1.91,1.42-3.73,3-5.66,4.37-4.52,3.3-8.57,7.05-11.4,11.94-1.93,3.34-2.68,7.14-3.41,10.88-.36,1.83-.78,3.65-1,5.49a133,133,0,0,0-1.46,20.5C114,143.68,114.21,146.47,114.43,149.25Z"/><path d="M315,322.85l0-.07,0,.08.19.07,1-2.59A132.62,132.62,0,0,0,322,299a3.2,3.2,0,0,0-.37-2.95c-1.68.53-3.24,2.23-4.52,3.36-2.22,2-4.34,4.07-6.38,6.23a54.18,54.18,0,0,0-10.29,16.25l-.81,1.86a72.45,72.45,0,0,1-4.18,8.29c-2.28,3.83-4.43,7.78-7.07,11.36-1.65,2.23-2.85,4.86-5.1,6.64a2.92,2.92,0,0,0-.68,1c-.57,1.11-.28,1.57,1.23,1.56a5.07,5.07,0,0,0,1.13-.24c2.19-.9,4.4-1.78,6.55-2.79,2.57-1.2,5.14-2.41,7.61-3.81a27.7,27.7,0,0,0,7.44-6c3.59-4.19,5.65-9.45,7.63-14.53a.92.92,0,0,0,0-.19l-.37.81.14-.36,0-.08.1-.25.1-.23s0,.08,0,.11a13.46,13.46,0,0,0,.79-2.13Z"/><path d="M307.87,231.88c-.63-2.26-1.44-8.6-4.94-6.59-1.72,1-2.32,4.19-3.07,5.87a59.22,59.22,0,0,1-5.48,9.75,87,87,0,0,1-7.64,8.81c-2.08,2.27-5.82,4.3-6.61,7.49-.86,3.49,3.87,6.24,5.92,8.63-.39.35-.7.65-1,.93a60.75,60.75,0,0,1-26.21,12.65c-6.11,1.4-12.27,2.26-18.55,1.2-1.06-.18-1.42-.54-1.42-1.67q0-30.24-.18-60.48-.07-20.28-.19-40.56c0-1.16.33-1.48,1.47-1.46q5,.1,10.08,0a5.5,5.5,0,0,1,4.07,1.39,9.62,9.62,0,0,0,13.78-1.53,9.78,9.78,0,1,0-15.7-11.65,2.06,2.06,0,0,1-1.95,1c-3.56,0-7.12,0-10.68,0-.82,0-1.12-.23-1.11-1.08,0-2.88,0-5.76,0-8.64a2.44,2.44,0,0,1,.76-1.59,21.09,21.09,0,0,0,1.5-30.87c-9.64-10.09-26.87-7.81-33.51,4.44a21.08,21.08,0,0,0,4.29,26,2.72,2.72,0,0,1,.79,1.72c.09,3,0,5.92.09,8.88,0,1-.32,1.22-1.24,1.21-3.48,0-7,0-10.44,0a1.67,1.67,0,0,1-1.57-.83,9.78,9.78,0,1,0-1.09,12.44,2.86,2.86,0,0,1,1.76-.72c3.6-.08,7.2-.08,10.8-.08,1.9,0,1.81-.32,1.82,1.78q.12,35.1.23,70.2c0,10.12,0,20.24.13,30.36,0,1.19-.38,1.65-1.5,1.75-1.31.11-2.62.42-3.93.44a64.09,64.09,0,0,1-35.62-10c-2.25-1.41-4.32-3.11-6.6-4.76,1.78-2.11,7.86-6.35,6.51-9.68-.57-1.4-4.13-3.38-5.32-4.49a73.71,73.71,0,0,1-5.29-5.44,62.13,62.13,0,0,1-8.45-12.34c-1.07-2.07-3.55-5.17-6-5.92-11.53-3.47-3.73,42.4-2.49,47.64a9.16,9.16,0,0,0,1.15,3.1c1.87,2.75,5.66,2,8.07.48.84-.52,6-5.12,5.5-5.87l1.38,2.14A38.16,38.16,0,0,0,174,289.22c7.77,4.21,16.31,8.6,25,10.53,8,1.78,14.81,4,19.41,11.64a43.68,43.68,0,0,0,3.17,5.18,5.87,5.87,0,0,0,10.13-.24,54.78,54.78,0,0,0,3-5.21c3.47-5.9,9-8.35,15.1-10.65,7.77-2.94,15.65-5.47,23.17-9.08,8.18-3.92,14.75-9.49,19.28-17.39a3.1,3.1,0,0,1,.44-.47c-.67.7,6.89,8,8.06,8.39,6.89,2.11,9.16-15.33,9.69-19.7A78.05,78.05,0,0,0,307.87,231.88ZM260.79,165.4A4.59,4.59,0,1,1,256.2,170,4.59,4.59,0,0,1,260.79,165.4Zm-69.5,9.18a4.59,4.59,0,1,1,4.59-4.59A4.59,4.59,0,0,1,191.29,174.58Zm34.66-26.32a10.11,10.11,0,1,1,10.11-10.11A10.11,10.11,0,0,1,225.95,148.26Z"/></svg>
\ No newline at end of file
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 452.62 428.54"><title>Anchor-with-border</title><path d="M360,219.84c-.79-1.48-1.65-2.92-2.51-4.36a23.88,23.88,0,0,0-1.71-2.6,1.72,1.72,0,0,0-1.25-.69c-.34.05-.69.68-.84,1.11a7.27,7.27,0,0,0-.23,1.77c-.22,3.18-.17,6.41-.69,9.55a30.79,30.79,0,0,0,1.14,14.65c.85,2.66,1.84,5.28,2.51,8,1.39,5.62,2.81,11.24,3.85,16.93.71,3.95.78,8,1.17,12,.13,1.32.34,2.62.51,3.93l.58.2a13.84,13.84,0,0,0,1.84-2,34.65,34.65,0,0,0,2-4c1.19-2.7,2.38-5.41,3.44-8.17a44.08,44.08,0,0,0,1.72-5.6c1.23-5.18.37-10.22-1.13-15.22A139.62,139.62,0,0,0,360,219.84Z"/><path d="M170.4,331.84c1.72-.22,3.46-.39,5.17-.67a26.86,26.86,0,0,0,4.42-1c1.27-.44,1.29-1.19.21-2a11.32,11.32,0,0,0-1.75-1c-2.92-1.38-5.89-2.65-8.75-4.13a33.81,33.81,0,0,0-12.46-3.85c-1.61-.15-3.25,0-4.88-.13-2.35-.13-4.71-.22-7-.53-4.94-.67-9.9-1.26-14.77-2.29-4.63-1-9.15-2.5-13.74-3.71a8.16,8.16,0,0,0-2.24,0,6.92,6.92,0,0,0,.84,2.13,67.2,67.2,0,0,0,5.5,5.83c2.94,2.65,5.5,5.78,9.13,7.6,1.85.92,3.61,2.24,5.56,2.7a80,80,0,0,0,12.53,1.83A113.22,113.22,0,0,0,170.4,331.84Z"/><path d="M96.63,144a104.6,104.6,0,0,0,2.11,17.66c1,4.94,2.38,9.83,3.62,14.73a8.36,8.36,0,0,0,.93,2.31c.44.71,1.1.85,1.56,0A19.49,19.49,0,0,0,106,176c1.12-3.32,2.12-6.69,3.31-10a30.33,30.33,0,0,0,1.87-11.4c-.1-2.74-.48-5.47-.51-8.21-.06-5.71-.2-11.43.14-17.12.27-4.51,1.21-9,1.84-13.46a35.64,35.64,0,0,0,.41-3.68c0-1-.49-1.24-1.3-.69A8.47,8.47,0,0,0,110,113q-2.28,2.7-4.43,5.49c-3.1,4-6.07,8.08-7.76,13A24.94,24.94,0,0,0,96.63,141C96.63,142.24,96.6,143.12,96.63,144Z"/><path d="M267.84,75.3c-4.73,1.29-9.43,2.74-14.05,4.39-3.12,1.12-6.08,2.69-9.09,4.1-.34.16-.82.64-.77.88a2.07,2.07,0,0,0,.86,1,2.37,2.37,0,0,0,1,.34c1.61.25,3.24.39,4.83.72,4.09.85,8,2.19,12.31,2.32a38.91,38.91,0,0,0,10.24-.9c2.3-.54,4.62-1,6.95-1.43a47,47,0,0,1,4.75-.45c5.22-.34,10.43-.75,15.66-.93,2.94-.1,5.9.2,8.73.32a18.63,18.63,0,0,0,2.16,0c.88-.11,1.15-.75.59-1.45a6.8,6.8,0,0,0-1.46-1.41,55,55,0,0,0-4.69-3c-3.6-2-7.18-4-10.93-5.65a21.78,21.78,0,0,0-11.35-1.79c-1.86.22-3.72.5-5.56.85C274.62,73.84,271.18,74.38,267.84,75.3Z"/><path d="M197.19,74.67a.56.56,0,0,0-.08.09c-.94,1-1.91,1.92-2.81,2.93-3.4,3.81-6.81,7.61-10.13,11.49a7.15,7.15,0,0,0-.84,2.34,10.12,10.12,0,0,0,2.6,0c3-.76,5.89-1.77,8.88-2.49a36.2,36.2,0,0,0,14.25-6.64c2-1.58,3.92-3.32,6-4.82,3.3-2.39,6.58-4.84,10.07-6.91,4.63-2.75,9.46-5.16,14.21-7.71,1.27-.68,2.56-1.33,3.83-2,.29-.15.79-.39.78-.55a1.49,1.49,0,0,0-.53-1.08,6.26,6.26,0,0,0-2.17-.61c-4.34-.33-8.69-.59-11.76-.79-7.82.08-13.82,1.8-19.08,5.82-2.28,1.74-4.53,3.53-6.83,5.26S199.57,73.09,197.19,74.67Z"/><path d="M379.43,196.41c-.33-3.08-.42-6.2-1.58-9.17-1.26-3.26-2.5-6.49-4.9-9.12-1.07-1.17-2.21-2.29-3.36-3.39-3.58-3.42-7.14-6.85-10.78-10.19a39.3,39.3,0,0,0-3.92-2.92c-3.32-2.36-6.64-4.71-10-7a15.34,15.34,0,0,0-2.71-1.52,5.24,5.24,0,0,0-1.7-.12,5.13,5.13,0,0,0,0,1.71c.39,1.2.94,2.36,1.45,3.53,1.15,2.67,2.44,5.29,3.45,8a31.21,31.21,0,0,0,7.38,11.15c3.33,3.37,6.72,6.69,9.91,10.19a112.78,112.78,0,0,1,12.72,17.23c.86,1.39,1.71,2.79,2.67,4.12.68.94,1.4.82,1.66-.3a24.16,24.16,0,0,0,.36-3.2C379.85,202.23,379.75,199.31,379.43,196.41Z"/><path d="M240,339.32a7.58,7.58,0,0,0,1.31-2.26,8.56,8.56,0,0,0-2.34-.6c-4.51.15-9,.39-13.52.64a30.11,30.11,0,0,0-12.08,3.28c-1.66.84-3.26,1.83-5,2.6s-3.39,1.25-5.08,1.92c-1.48.58-2.9,1.36-4.41,1.84-2.83.9-5.71,1.69-8.58,2.45-2.7.72-5.42,1.37-8.15,2-1.91.45-3.85.83-5.77,1.24a8.26,8.26,0,0,0-.94.15c-.77.26-.94.94-.3,1.44a7.87,7.87,0,0,0,2.06,1.2c1.76.65,3.54,1.25,5.34,1.75,3.5,1,7,2,10.54,2.74a49.28,49.28,0,0,0,7,.4,36.39,36.39,0,0,0,5.64-1.31c4.07-1.6,8.1-3.33,12-5.27A117.38,117.38,0,0,0,240,339.32Z"/><path d="M136.27,107.74c-.86,2.78-1.57,5.61-2.27,8.44-.63,2.6-1.15,5.22-1.75,8,.22.47.33,1.18.73,1.42s1-.19,1.45-.45a8.14,8.14,0,0,0,1.36-1.17c2.35-2.27,4.72-4.52,7-6.83a54.53,54.53,0,0,0,4.76-5.05,32.69,32.69,0,0,0,3.49-5.68c2-4.13,3.77-8.39,5.77-12.53a68.73,68.73,0,0,1,4.1-7.38c2.62-4.06,5.4-8,8.15-12,.82-1.18,1.82-2.24,2.61-3.43a4.34,4.34,0,0,0,.27-1.69,3.88,3.88,0,0,0-1.42-.14,33.84,33.84,0,0,0-4.48,1.57c-3.22,1.49-6.36,3.15-9.58,4.64-3,1.39-5.32,3.65-7.74,5.8-3.07,2.74-4.38,6.58-6.18,10.09a77.39,77.39,0,0,0-3.24,7.59C138.23,101.83,137.19,104.77,136.27,107.74Z"/><path d="M324.51,109.34c-2.42-.58-4.88-1-7.34-1.38-4.57-.7-9.15-1.31-13.73-2l0,.23a1.43,1.43,0,0,0-.36,0l-2.54.7a11.13,11.13,0,0,0,1.57,2.21c2.61,2.24,5.36,4.33,8,6.58a32.32,32.32,0,0,0,13.28,7.36c1.66.41,3.35.72,5,1.24,2.2.71,4.39,1.47,6.51,2.39,5,2.17,10,4.39,15,6.7,2,1,4,2.18,5.91,3.3,1.25.71,2.44,1.53,3.72,2.17a4.51,4.51,0,0,0,1.68.12,4.78,4.78,0,0,0,0-1.69,21.42,21.42,0,0,0-1.77-3.5c-3-4.57-5.44-9.44-9.35-13.39a25.89,25.89,0,0,0-8.5-6,78.25,78.25,0,0,0-7.6-2.5C330.74,111,327.64,110.09,324.51,109.34Z"/><path d="M111.44,287.41c2.49,1.21,5,2.39,7.53,3.51,1.16.51,2.41.83,3.61,1.24,2.18.73,4.34,1.53,6.55,2.15a6.15,6.15,0,0,0,2.18-.22,8.36,8.36,0,0,0-.78-2.13c-1.37-1.91-2.89-3.72-4.3-5.6s-2.61-3.83-4.11-5.59a46.67,46.67,0,0,0-4.85-4.83,28.81,28.81,0,0,0-3.85-2.58c-1.1-.68-2.26-1.29-3.39-1.93a107.63,107.63,0,0,1-14.69-10.05c-2.48-2-5-4-7.34-6.16s-4.89-4.64-7.32-7l-.52.1c-.13.45-.44.92-.37,1.33a46.07,46.07,0,0,0,1.1,5.12c.61,2.09,1.53,4.1,2.09,6.2a31.55,31.55,0,0,0,3.91,9.08,23,23,0,0,0,5.84,6.75c2.91,2,5.9,4,9,5.69S108.18,285.82,111.44,287.41Z"/><path d="M75.58,200.93a45.89,45.89,0,0,0,2,5.94c1.52,3.07,3.28,6,5.07,9a77.62,77.62,0,0,0,4.49,6.64c2.55,3.35,5.21,6.61,7.9,9.86,1.46,1.76,3,3.43,4.6,5.08a20.43,20.43,0,0,0,2.68,2.35c1,.73,1.67.4,1.61-.86a36.89,36.89,0,0,0-.61-4c-.38-2.39-.88-4.77-1.1-7.17a30,30,0,0,0-2.41-9.7c-1.15-2.55-2.71-4.91-4.11-7.34s-3-4.87-4.31-7.37-2.66-5.13-3.83-7.77q-2.38-5.4-4.49-10.92c-.88-2.3-1.48-4.71-2.31-7A6.81,6.81,0,0,0,79.55,176c-.43.49-1.05.91-1.24,1.48a29,29,0,0,0-1.09,4.4c-.55,3.33-1.1,6.67-1.44,10-.25,2.4-.19,4.83-.21,7.25a7.55,7.55,0,0,0,.39,1.71Z"/><path d="M268.49,335c1-1.15,1.78-2.45,2.64-3.69.42-.6.25-1.18-.43-1.3a5,5,0,0,0-2.17.1c-3.42,1-6.8,2.09-10.24,3a34.66,34.66,0,0,0-9.36,3.85c-1,.61-1.95,1.36-2.93,2-1.19.81-2.31,1.72-3.43,2.65-1.45,1.22-2.88,2.47-4.39,3.6a96.19,96.19,0,0,1-9,6c-2.86,1.67-5.74,3.33-8.68,4.86s-6.16,3-9.22,4.5a1.73,1.73,0,0,0-.74,1.11c0,.19.46.61.78.74a7.2,7.2,0,0,0,1.85.44c2.3.23,4.61.55,6.92.6a86.65,86.65,0,0,0,10.41-.17,34.5,34.5,0,0,0,7.82-1.89c3.33-1.16,5.61-3.38,8.32-5.48s5.31-4.09,7.87-6.29A129.19,129.19,0,0,0,268.49,335Z"/><path d="M226.12,74.23C224,75.5,222,77,219.92,78.5c-1,.68-1.81,1.51-2.77,2.2s-1.94,1.09-2.76,1.81a8.22,8.22,0,0,0-1.26,1.93c.66.24,1.32.49,2,.7a2.14,2.14,0,0,0,.71.06c4.19-.15,8.38-.28,12.57-.46a23.47,23.47,0,0,0,3.81-.39c6-1.27,11.41-4.43,17.08-6.69,3.33-1.33,6.66-2.65,10-3.86a37.81,37.81,0,0,1,4.4-1.09L275.47,70a32.19,32.19,0,0,0,3.38-.79c1.23-.42,1.31-1.13.22-1.84a9,9,0,0,0-1.84-.69c-2.29-.84-4.53-1.82-6.86-2.48-3.06-.86-6.17-1.56-9.29-2.17-7.95-1.57-16.07,1.81-22.92,5.49C234.11,69.72,230.08,71.9,226.12,74.23Z"/><path d="M84,176c1,3.53,2.36,7,3.65,10.42,1.07,2.81,2.2,5.61,3.44,8.35,1.11,2.47,2.32,4.9,3.62,7.28s2.73,4.59,4.17,6.84c.24.37.89.79,1.21.7a1.64,1.64,0,0,0,.83-1.17c.21-1.26.27-2.54.37-3.81.14-1.86.22-3.74.41-5.6.35-3.33.93-6.67.33-10a71,71,0,0,0-1.64-7.89c-.86-2.82-2.21-5.41-2.91-8.33-.81-3.4-1.64-6.81-2.25-10.26-.74-4.16-1.33-8.35-1.86-12.54-.26-2.05-.18-4.15-.39-6.21a9.19,9.19,0,0,0-.83-2.22c-.63.55-1.46,1-1.84,1.68-1.07,1.93-2,3.94-2.89,6-1,2.26-2,4.54-2.85,6.86a31,31,0,0,0-2.13,10.81,25,25,0,0,0,.63,5.51C83.35,173.58,83.66,174.79,84,176Z"/><path d="M87.73,250a113.13,113.13,0,0,0,15.08,12.54c2.21,1.51,4.4,3.06,6.65,4.52a25.55,25.55,0,0,0,3.48,1.87c.86.39,1.58-.06,1.41-.77a15,15,0,0,0-.82-2.58c-.51-1.19-1.18-2.32-1.7-3.52-1.53-3.53-2.86-7.17-4.58-10.6a30.94,30.94,0,0,0-7.33-9.1,92.22,92.22,0,0,1-8.67-8.93,78.49,78.49,0,0,1-5.52-6.9C82.78,222.3,80,218,77.18,213.67a5.74,5.74,0,0,0-1-1.18c-.58-.5-1.07-.31-1.23.42a13.17,13.17,0,0,0-.38,2.7c0,1.92.08,3.84.24,5.75.43,5.09.68,10.19,2.62,15a34,34,0,0,0,6.9,10.12C85.46,247.74,86.61,248.89,87.73,250Z"/><path d="M290.38,333.8c.95-1.42,1.56-3.07,2.5-4.49.81-1.22,1.23-2.59,2-3.84a40.63,40.63,0,0,0,2.21-4.1c.37-.75,2.46-4.68,1-5a2.9,2.9,0,0,0-1.83.21,81.71,81.71,0,0,0-10.12,6.79c-1.63,1.22-3.61,1.41-5.25,2.56-3.11,2.19-5,5.48-7.4,8.34-3.48,4.17-7,8.32-10.65,12.31a116.71,116.71,0,0,1-14.61,12.93,4.4,4.4,0,0,0-1.12,1.22c-.11.2.13.87.3.91a7.61,7.61,0,0,0,2.68.31c3.15-.5,6.27-1.19,9.41-1.71A36.47,36.47,0,0,0,272,355.89c4.83-2.8,8.32-7.64,11.47-12.13C285.78,340.45,288.14,337.16,290.38,333.8Z"/><path d="M339.29,271.2a1.8,1.8,0,0,0-1.37.68,20.49,20.49,0,0,0-1.54,2.35c-2.13,3.37-4.36,6.68-6.33,10.15a42.58,42.58,0,0,0-3,6.84,33.85,33.85,0,0,0-1.1,5.12c-.48,2.58-.85,5.18-1.39,7.74-.47,2.25-1.12,4.47-1.68,6.7a32.8,32.8,0,0,1-1.89,6.28,66.17,66.17,0,0,0-2.56,6.53c-1.11,3.16-2.24,6.24-3.6,9.3a5.72,5.72,0,0,0-.4,1.13c-.16.78.21,1.17,1,1.06a3.35,3.35,0,0,0,1.33-.47c1.18-.78,2.35-1.59,3.46-2.47,2.36-1.85,4.69-3.75,7-5.65a43.8,43.8,0,0,0,6.24-6.61c.42-.52.82-1.06,1.19-1.62,1.82-2.77,2.3-5.9,2.86-9.08.69-3.92,1.47-7.82,2-11.76a69.28,69.28,0,0,0,.81-8.94c.07-5.35-.1-10.7-.24-16A1.6,1.6,0,0,0,339.29,271.2Z"/><path d="M357.9,277.22c-.33-3.25-.65-6.49-1-9.73s-.69-6.27-1.32-9.35c-.8-3.86-1.88-7.67-2.88-11.49a19.74,19.74,0,0,0-1-3.05,1.68,1.68,0,0,0-1.09-.88c-.33,0-.84.35-1.09.69a5.38,5.38,0,0,0-.68,1.52c-1.25,3.81-2.42,7.66-3.75,11.44a30,30,0,0,0-1.64,8.62,58.37,58.37,0,0,0,.43,6.66c.16,2.28.28,4.63.28,6.92,0,3.48,0,7-.22,10.43-.24,3.94-.65,7.88-1.12,11.8-.32,2.68-.85,5.34-1.32,8.24l.45,1.43c.6-.26,1.21-.51,1.8-.78.1,0,.16-.17.24-.26a82.06,82.06,0,0,0,10.58-14.15A28.14,28.14,0,0,0,358,279.12Q358,278.17,357.9,277.22Z"/><path d="M178.34,348c1.61-.28,3.23-.55,4.83-.92,3.41-.8,6.83-1.58,10.2-2.55,2.22-.63,4.36-1.54,6.52-2.37,3-1.16,6-2.3,9-3.58.71-.31,1.19-1.14,1.78-1.72a8.61,8.61,0,0,0-2.18-1.21c-3.08-.67-6.21-1.07-9.27-1.8-4.42-1.06-8.86-1.78-13.39-1.09-1.79.27-3.42,1-5.21,1.24s-3.61.43-5.4.76-3.44.7-5.18.89c-2.06.22-4.14.32-6.21.36-4.59.09-9.18.15-13.77.15-2.16,0-4.31-.21-6.47-.22a2,2,0,0,0-1.34.77c-.12.15.29.81.56,1.17a3.2,3.2,0,0,0,.89.79c2.87,1.8,5.72,3.66,8.66,5.34a45,45,0,0,0,7.27,3.64c3.89,1.37,9,2.74,13.15,1.55A51.64,51.64,0,0,1,178.34,348Z"/><path d="M376.75,214.15a69.55,69.55,0,0,0-5.08-8.58c-1.29-2-2.55-4.06-4-6-2.69-3.53-5.44-7-8.29-10.42-1.84-2.2-3.86-4.25-5.91-6.26a9.48,9.48,0,0,0-2.41-1.28,9.8,9.8,0,0,0-.41,2.72q.62,4.61,1.54,9.19c.57,2.84,1.31,5.65,2,8.47a18.76,18.76,0,0,0,2.62,5.9c1.37,2.13,2.68,4.06,3.87,6.25,1.37,2.53,2.85,5,4.16,7.56,1.49,2.91,2.79,5.92,4.07,8.94,1.09,2.57,2,5.21,3,7.81.33.85.74,1.67,1,2.53.44,1.26.75,2.56,1.25,3.79a1.69,1.69,0,0,0,1.11.76c.18,0,.58-.48.74-.81a7.86,7.86,0,0,0,.73-2c.81-5,1.82-9.89,2.26-14.88a36.37,36.37,0,0,0-.75-8.73A19.4,19.4,0,0,0,376.75,214.15Z"/><path d="M355.55,140.78a106,106,0,0,0-15.49-8q-6.59-2.53-13.19-5a10.89,10.89,0,0,0-2.42-.65c-1.11-.14-1.6.55-1.07,1.53a19.41,19.41,0,0,0,1.72,2.53c.95,1.23,2,2.36,2.92,3.64,2.38,3.42,4.63,7,7.85,9.68a45.94,45.94,0,0,0,4.62,3.28c1.4.91,3,1.45,4.33,2.44,1.53,1.12,3.14,2.17,4.76,3.21a119.06,119.06,0,0,1,18.59,14.62c1.63,1.58,3.27,3.16,4.95,4.7a1.39,1.39,0,0,0,1.15.37c.26-.11.47-.72.44-1.1a15.3,15.3,0,0,0-.46-3.3c-.81-2.74-1.66-5.48-2.67-8.15a71.87,71.87,0,0,0-3.37-7.89c-2.48-4.78-6.47-8.06-10.91-10.84Q356.44,141.3,355.55,140.78Z"/><path d="M304.73,89.09a101.26,101.26,0,0,0-18.55.49c-3.88.42-7.71,1.28-11.55,2a1.5,1.5,0,0,0-1,.81c-.09.26.27.84.59,1a24.08,24.08,0,0,0,2.74,1.46c2.63,1.24,5.35,2.32,7.91,3.7,9,4.83,19,3.76,28.8,5.16,4.19.6,8.4,1.26,12.52,2.22s8.12,2.32,12.19,3.45a4.43,4.43,0,0,0,1.55-.15,4.28,4.28,0,0,0-.36-1.53,22.24,22.24,0,0,0-2.74-3.35c-3.69-3.45-7.29-7-11.27-10.15-4.28-3.34-9.19-4.24-14.27-4.68C309.1,89.36,306.92,89.26,304.73,89.09Z"/><path d="M129,312.23a118.55,118.55,0,0,0,20.09,3.11,30.71,30.71,0,0,0,3.83,0c1.17-.07,1.43-.76.7-1.69A4.4,4.4,0,0,0,153,313c-1.77-1.46-3.52-2.94-5.33-4.34-3.06-2.35-6.13-4.68-9.26-6.95-4.24-3.07-10.09-3.74-15-5.4-.74-.25-1.57-.29-2.29-.6-4.6-2-9.24-3.94-13.76-6.12-3.55-1.72-6.95-3.75-10.4-5.67-1.11-.61-2.15-1.39-3.81-1a12.58,12.58,0,0,0,.78,2.55c1.3,2.34,2.74,4.59,4.07,6.9,2.87,5,6.25,9.6,11.12,12.81a35.76,35.76,0,0,0,7.77,3.72C120.92,310.31,125.15,311.28,129,312.23Z"/><path d="M161.89,91.92c-1.1,1.83-1.86,3.85-2.8,5.78-1.06,2.17-2.16,4.31-3.19,6.49a1.32,1.32,0,0,0,.11,1.19,1.53,1.53,0,0,0,1.19.24,3.71,3.71,0,0,0,1.3-.58c1.48-.93,2.89-2,4.42-2.82a73.73,73.73,0,0,0,10.61-6.43,33.32,33.32,0,0,0,5.8-6.47c.82-1.09,1.71-2,2.6-3s1.56-2.51,2.73-3.5a38.73,38.73,0,0,0,3.49-3.91,113.56,113.56,0,0,1,13.76-13.16c.54-.43.89-1.11,1.44-1.52,1-.74,2.1-1.3,3-2.08a8.47,8.47,0,0,0,1.29-1.77l-.25-.47a25.3,25.3,0,0,0-3.14-.12,25.83,25.83,0,0,0-3.28.61c-4.21.9-8.48,1.57-12.6,2.76-9.29,2.7-15.1,11.4-20.21,18.95C166,85.33,163.89,88.58,161.89,91.92Z"/><path d="M114.43,149.25a1.85,1.85,0,0,0,.92,1.33c.29.12,1-.38,1.3-.77a24.72,24.72,0,0,0,2.11-3.26c2.47-4.68,6.12-8.64,7.95-13.75.86-2.4,1.47-4.92,2.17-7.35s.53-5.3,1.11-7.74c.62-2.63,1.29-5.24,2-7.85a124.36,124.36,0,0,1,6.46-18.14c.55-1.27,1.13-2.55,1.58-3.86.34-1-.08-1.4-1.08-1.12a6.22,6.22,0,0,0-2,1c-1.91,1.42-3.73,3-5.66,4.37-4.52,3.3-8.57,7.05-11.4,11.94-1.93,3.34-2.68,7.14-3.41,10.88-.36,1.83-.78,3.65-1,5.49a133,133,0,0,0-1.46,20.5C114,143.68,114.21,146.47,114.43,149.25Z"/><path d="M315,322.85l0-.07,0,.08.19.07,1-2.59A132.62,132.62,0,0,0,322,299a3.2,3.2,0,0,0-.37-2.95c-1.68.53-3.24,2.23-4.52,3.36-2.22,2-4.34,4.07-6.38,6.23a54.18,54.18,0,0,0-10.29,16.25l-.81,1.86a72.45,72.45,0,0,1-4.18,8.29c-2.28,3.83-4.43,7.78-7.07,11.36-1.65,2.23-2.85,4.86-5.1,6.64a2.92,2.92,0,0,0-.68,1c-.57,1.11-.28,1.57,1.23,1.56a5.07,5.07,0,0,0,1.13-.24c2.19-.9,4.4-1.78,6.55-2.79,2.57-1.2,5.14-2.41,7.61-3.81a27.7,27.7,0,0,0,7.44-6c3.59-4.19,5.65-9.45,7.63-14.53a.92.92,0,0,0,0-.19l-.37.81.14-.36,0-.08.1-.25.1-.23s0,.08,0,.11a13.46,13.46,0,0,0,.79-2.13Z"/><path d="M307.87,231.88c-.63-2.26-1.44-8.6-4.94-6.59-1.72,1-2.32,4.19-3.07,5.87a59.22,59.22,0,0,1-5.48,9.75,87,87,0,0,1-7.64,8.81c-2.08,2.27-5.82,4.3-6.61,7.49-.86,3.49,3.87,6.24,5.92,8.63-.39.35-.7.65-1,.93a60.75,60.75,0,0,1-26.21,12.65c-6.11,1.4-12.27,2.26-18.55,1.2-1.06-.18-1.42-.54-1.42-1.67q0-30.24-.18-60.48-.07-20.28-.19-40.56c0-1.16.33-1.48,1.47-1.46q5,.1,10.08,0a5.5,5.5,0,0,1,4.07,1.39,9.62,9.62,0,0,0,13.78-1.53,9.78,9.78,0,1,0-15.7-11.65,2.06,2.06,0,0,1-1.95,1c-3.56,0-7.12,0-10.68,0-.82,0-1.12-.23-1.11-1.08,0-2.88,0-5.76,0-8.64a2.44,2.44,0,0,1,.76-1.59,21.09,21.09,0,0,0,1.5-30.87c-9.64-10.09-26.87-7.81-33.51,4.44a21.08,21.08,0,0,0,4.29,26,2.72,2.72,0,0,1,.79,1.72c.09,3,0,5.92.09,8.88,0,1-.32,1.22-1.24,1.21-3.48,0-7,0-10.44,0a1.67,1.67,0,0,1-1.57-.83,9.78,9.78,0,1,0-1.09,12.44,2.86,2.86,0,0,1,1.76-.72c3.6-.08,7.2-.08,10.8-.08,1.9,0,1.81-.32,1.82,1.78q.12,35.1.23,70.2c0,10.12,0,20.24.13,30.36,0,1.19-.38,1.65-1.5,1.75-1.31.11-2.62.42-3.93.44a64.09,64.09,0,0,1-35.62-10c-2.25-1.41-4.32-3.11-6.6-4.76,1.78-2.11,7.86-6.35,6.51-9.68-.57-1.4-4.13-3.38-5.32-4.49a73.71,73.71,0,0,1-5.29-5.44,62.13,62.13,0,0,1-8.45-12.34c-1.07-2.07-3.55-5.17-6-5.92-11.53-3.47-3.73,42.4-2.49,47.64a9.16,9.16,0,0,0,1.15,3.1c1.87,2.75,5.66,2,8.07.48.84-.52,6-5.12,5.5-5.87l1.38,2.14A38.16,38.16,0,0,0,174,289.22c7.77,4.21,16.31,8.6,25,10.53,8,1.78,14.81,4,19.41,11.64a43.68,43.68,0,0,0,3.17,5.18,5.87,5.87,0,0,0,10.13-.24,54.78,54.78,0,0,0,3-5.21c3.47-5.9,9-8.35,15.1-10.65,7.77-2.94,15.65-5.47,23.17-9.08,8.18-3.92,14.75-9.49,19.28-17.39a3.1,3.1,0,0,1,.44-.47c-.67.7,6.89,8,8.06,8.39,6.89,2.11,9.16-15.33,9.69-19.7A78.05,78.05,0,0,0,307.87,231.88ZM260.79,165.4A4.59,4.59,0,1,1,256.2,170,4.59,4.59,0,0,1,260.79,165.4Zm-69.5,9.18a4.59,4.59,0,1,1,4.59-4.59A4.59,4.59,0,0,1,191.29,174.58Zm34.66-26.32a10.11,10.11,0,1,1,10.11-10.11A10.11,10.11,0,0,1,225.95,148.26Z"/></svg>
\ No newline at end of file
......@@ -60,6 +60,7 @@
- pipeline_default:build_trace_sections
- pipeline_default:pipeline_metrics
- pipeline_default:pipeline_notification
- pipeline_default:ci_build_schedule
- pipeline_hooks:build_hooks
- pipeline_hooks:pipeline_hooks
- pipeline_processing:build_finished
......
......@@ -9,6 +9,7 @@ class BuildFinishedWorker
# rubocop: disable CodeReuse/ActiveRecord
def perform(build_id)
Ci::Build.find_by(id: build_id).try do |build|
build&.build_schedule&.delete
# We execute that in sync as this access the files in order to access local file, and reduce IO
BuildTraceSectionsWorker.new.perform(build.id)
BuildCoverageWorker.new.perform(build.id)
......
# frozen_string_literal: true
module Ci
class BuildScheduleWorker
include ApplicationWorker
include PipelineQueue
def perform(build_id)
::Ci::Build.preload(:build_schedule).find_by(id: build_id).try do |build|
break unless build.build_schedule.present?
Ci::PlayBuildService.new(build.project, build.user).execute(build)
end
end
end
end
# frozen_string_literal: true
class CreateBuildSchedules < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def change
create_table :ci_build_schedules, id: :bigserial do |t|
t.integer :build_id, null: false
t.datetime :execute_at, null: false
t.foreign_key :ci_builds, column: :build_id, on_delete: :cascade
t.index :build_id, unique: true
end
end
end
......@@ -260,6 +260,13 @@ ActiveRecord::Schema.define(version: 20180924141949) do
add_index "chat_teams", ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree
create_table "ci_build_schedules", id: :bigserial, force: :cascade do |t|
t.integer "build_id", null: false
t.datetime "execute_at", null: false
end
add_index "ci_build_schedules", ["build_id"], name: "index_ci_build_schedules_on_build_id", unique: true, using: :btree
create_table "ci_build_trace_chunks", id: :bigserial, force: :cascade do |t|
t.integer "build_id", null: false
t.integer "chunk_index", null: false
......@@ -2288,6 +2295,7 @@ ActiveRecord::Schema.define(version: 20180924141949) do
add_foreign_key "boards", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade
add_foreign_key "chat_teams", "namespaces", on_delete: :cascade
add_foreign_key "ci_build_schedules", "ci_builds", column: "build_id", on_delete: :cascade
add_foreign_key "ci_build_trace_chunks", "ci_builds", column: "build_id", on_delete: :cascade
add_foreign_key "ci_build_trace_section_names", "projects", on_delete: :cascade
add_foreign_key "ci_build_trace_sections", "ci_build_trace_section_names", column: "section_name_id", name: "fk_264e112c66", on_delete: :cascade
......
......@@ -10,7 +10,7 @@ module Gitlab
include Attributable
ALLOWED_KEYS = %i[tags script only except type image services
allow_failure type stage when artifacts cache
allow_failure type stage when autoplay_in artifacts cache
dependencies before_script after_script variables
environment coverage retry extends].freeze
......@@ -34,6 +34,14 @@ module Gitlab
validates :dependencies, array_of_strings: true
validates :extends, type: String
with_options if: :manual_action? do
validates :autoplay_in, duration: true, allow_nil: true
end
with_options unless: :manual_action? do
validates :autoplay_in, presence: false
end
end
end
......@@ -84,7 +92,7 @@ module Gitlab
:artifacts, :commands, :environment, :coverage, :retry
attributes :script, :tags, :allow_failure, :when, :dependencies,
:retry, :extends
:retry, :extends, :autoplay_in
def compose!(deps = nil)
super do
......
......@@ -5,6 +5,7 @@ module Gitlab
class Factory < Status::Factory
def self.extended_statuses
[[Status::Build::Erased,
Status::Build::ManualWithAutoPlay,
Status::Build::Manual,
Status::Build::Canceled,
Status::Build::Created,
......
module Gitlab
module Ci
module Status
module Build
class ManualWithAutoPlay < Status::Extended
###
# TODO: Those are random values. We have to fix accoding to the UX review
###
###
# Core override
###
def text
s_('CiStatusText|scheduled')
end
def label
s_('CiStatusLabel|scheduled')
end
def icon
'timer'
end
def favicon
'favicon_status_manual_with_auto_play'
end
###
# Extension override
###
def illustration
{
image: 'illustrations/canceled-job_empty.svg',
size: 'svg-394',
title: _('This job is a scheduled job with manual actions!'),
content: _('auto playyyyyyyyyyyyyy! This job depends on a user to trigger its process. Often they are used to deploy code to production environments')
}
end
def status_tooltip
@status.status_tooltip + " (scheulded) : Execute in #{subject.build_schedule.execute_in.round} sec"
end
def self.matches?(build, user)
build.autoplay? && !build.canceled?
end
end
end
end
end
end
......@@ -49,7 +49,8 @@ module Gitlab
script: job[:script],
after_script: job[:after_script],
environment: job[:environment],
retry: job[:retry]
retry: job[:retry],
autoplay_in: job[:autoplay_in],
}.compact }
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment