debian-mirror-gitlab/spec/factories/ci/pipeline_schedule.rb

42 lines
1 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
FactoryBot.define do
2020-03-09 13:42:32 +05:30
factory :ci_pipeline_schedule, class: 'Ci::PipelineSchedule' do
2019-12-21 20:55:43 +05:30
cron { '0 1 * * *' }
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
ref { 'master' }
active { true }
description { "pipeline schedule" }
2017-09-10 17:25:29 +05:30
project
2017-08-17 22:00:37 +05:30
2019-09-04 21:01:54 +05:30
trait :every_minute do
2019-12-21 20:55:43 +05:30
cron { '*/1 * * * *' }
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
2019-09-04 21:01:54 +05:30
end
trait :hourly do
2019-12-21 20:55:43 +05:30
cron { '* */1 * * *' }
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
2019-09-04 21:01:54 +05:30
end
2017-08-17 22:00:37 +05:30
trait :nightly do
2019-12-21 20:55:43 +05:30
cron { '0 1 * * *' }
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
2017-08-17 22:00:37 +05:30
end
trait :weekly do
2019-12-21 20:55:43 +05:30
cron { '0 1 * * 6' }
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
2017-08-17 22:00:37 +05:30
end
trait :monthly do
2019-12-21 20:55:43 +05:30
cron { '0 1 22 * *' }
cron_timezone { Gitlab::Ci::CronParser::VALID_SYNTAX_SAMPLE_TIME_ZONE }
2017-08-17 22:00:37 +05:30
end
trait :inactive do
2019-12-21 20:55:43 +05:30
active { false }
2017-08-17 22:00:37 +05:30
end
end
end