2019-07-25 01:11:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2020-01-09 13:07:52 -05:00
|
|
|
factory :ci_pipeline_schedule, class: 'Ci::PipelineSchedule' do
|
2019-10-01 20:06:26 -04:00
|
|
|
cron { '0 1 * * *' }
|
|
|
|
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
|
|
|
|
ref { 'master' }
|
|
|
|
active { true }
|
|
|
|
description { "pipeline schedule" }
|
2017-08-02 15:55:11 -04:00
|
|
|
project
|
2017-04-07 08:47:29 -04:00
|
|
|
|
2019-05-17 08:10:44 -04:00
|
|
|
trait :every_minute do
|
2019-10-01 20:06:26 -04:00
|
|
|
cron { '*/1 * * * *' }
|
|
|
|
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
|
2019-05-17 08:10:44 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :hourly do
|
2019-10-01 20:06:26 -04:00
|
|
|
cron { '* */1 * * *' }
|
|
|
|
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
|
2019-05-17 08:10:44 -04:00
|
|
|
end
|
|
|
|
|
2017-04-04 08:22:12 -04:00
|
|
|
trait :nightly do
|
2019-10-01 20:06:26 -04:00
|
|
|
cron { '0 1 * * *' }
|
|
|
|
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
|
2017-03-22 14:54:49 -04:00
|
|
|
end
|
|
|
|
|
2017-04-04 08:22:12 -04:00
|
|
|
trait :weekly do
|
2019-10-01 20:06:26 -04:00
|
|
|
cron { '0 1 * * 6' }
|
|
|
|
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
|
2017-03-22 14:54:49 -04:00
|
|
|
end
|
|
|
|
|
2017-04-04 08:22:12 -04:00
|
|
|
trait :monthly do
|
2019-10-01 20:06:26 -04:00
|
|
|
cron { '0 1 22 * *' }
|
|
|
|
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
|
2017-03-22 14:54:49 -04:00
|
|
|
end
|
2017-05-07 18:35:56 -04:00
|
|
|
|
|
|
|
trait :inactive do
|
2019-10-01 20:06:26 -04:00
|
|
|
active { false }
|
2017-05-07 18:35:56 -04:00
|
|
|
end
|
2017-03-22 14:54:49 -04:00
|
|
|
end
|
|
|
|
end
|