Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
d9574c0c
Commit
d9574c0c
authored
Apr 01, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maintain MR
parent
57d082f3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
37 deletions
+8
-37
app/workers/trigger_schedule_worker.rb
app/workers/trigger_schedule_worker.rb
+0
-1
changelogs/unreleased/2989-run-cicd-pipelines-on-a-schedule-idea1-basic-backend-implementation.yml
...ines-on-a-schedule-idea1-basic-backend-implementation.yml
+4
-0
db/migrate/20170329095325_add_ref_to_triggers.rb
db/migrate/20170329095325_add_ref_to_triggers.rb
+0
-16
db/migrate/20170329095907_create_ci_trigger_schedules.rb
db/migrate/20170329095907_create_ci_trigger_schedules.rb
+0
-16
spec/helpers/triggers_helper_spec.rb
spec/helpers/triggers_helper_spec.rb
+4
-4
No files found.
app/workers/trigger_schedule_worker.rb
View file @
d9574c0c
...
@@ -9,7 +9,6 @@ class TriggerScheduleWorker
...
@@ -9,7 +9,6 @@ class TriggerScheduleWorker
trigger_schedule
.
trigger
,
trigger_schedule
.
trigger
,
trigger_schedule
.
ref
)
trigger_schedule
.
ref
)
rescue
=>
e
rescue
=>
e
puts
"
#{
trigger_schedule
.
id
}
: Failed to trigger_schedule job:
#{
e
.
message
}
"
# TODO: Remove before merge
Rails
.
logger
.
error
"
#{
trigger_schedule
.
id
}
: Failed to trigger_schedule job:
#{
e
.
message
}
"
Rails
.
logger
.
error
"
#{
trigger_schedule
.
id
}
: Failed to trigger_schedule job:
#{
e
.
message
}
"
ensure
ensure
trigger_schedule
.
schedule_next_run!
trigger_schedule
.
schedule_next_run!
...
...
changelogs/unreleased/2989-run-cicd-pipelines-on-a-schedule-idea1-basic-backend-implementation.yml
0 → 100644
View file @
d9574c0c
---
title
:
Resolve "Run CI/CD pipelines on a schedule" - "Basic backend implementation"
merge_request
:
10133
author
:
dosuken123
db/migrate/20170329095325_add_ref_to_triggers.rb
View file @
d9574c0c
...
@@ -7,22 +7,6 @@ class AddRefToTriggers < ActiveRecord::Migration
...
@@ -7,22 +7,6 @@ class AddRefToTriggers < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime.
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
DOWNTIME
=
false
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# DOWNTIME_REASON = ''
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# existing transaction. When using "add_concurrent_index" make sure that this
# method is the _only_ method called in the migration, any other changes
# should go in a separate migration. This ensures that upon failure _only_ the
# index creation fails and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
def
change
def
change
add_column
:ci_triggers
,
:ref
,
:string
add_column
:ci_triggers
,
:ref
,
:string
end
end
...
...
db/migrate/20170329095907_create_ci_trigger_schedules.rb
View file @
d9574c0c
...
@@ -7,22 +7,6 @@ class CreateCiTriggerSchedules < ActiveRecord::Migration
...
@@ -7,22 +7,6 @@ class CreateCiTriggerSchedules < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime.
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
DOWNTIME
=
false
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# DOWNTIME_REASON = ''
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# existing transaction. When using "add_concurrent_index" make sure that this
# method is the _only_ method called in the migration, any other changes
# should go in a separate migration. This ensures that upon failure _only_ the
# index creation fails and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
def
change
def
change
create_table
:ci_trigger_schedules
do
|
t
|
create_table
:ci_trigger_schedules
do
|
t
|
t
.
integer
"project_id"
t
.
integer
"project_id"
...
...
spec/helpers/triggers_helper_spec.rb
View file @
d9574c0c
...
@@ -7,8 +7,8 @@ describe TriggersHelper do
...
@@ -7,8 +7,8 @@ describe TriggersHelper do
subject
{
helper
.
real_next_run
(
trigger_schedule
,
worker_cron:
worker_cron
,
worker_time_zone:
'UTC'
)
}
subject
{
helper
.
real_next_run
(
trigger_schedule
,
worker_cron:
worker_cron
,
worker_time_zone:
'UTC'
)
}
context
'when next_run_at > worker_next_time'
do
context
'when next_run_at > worker_next_time'
do
let
(
:worker_cron
)
{
'
* * * * *'
}
# every minutes
let
(
:worker_cron
)
{
'
0 0 1 1 *'
}
# every 00:00, January 1st
let
(
:user_cron
)
{
'
0 0 1 1 *'
}
# every 00:00
, January 1st
let
(
:user_cron
)
{
'
1 0 1 1 *'
}
# every 00:01
, January 1st
it
'returns next_run_at'
do
it
'returns next_run_at'
do
is_expected
.
to
eq
(
trigger_schedule
.
next_run_at
)
is_expected
.
to
eq
(
trigger_schedule
.
next_run_at
)
...
@@ -16,8 +16,8 @@ describe TriggersHelper do
...
@@ -16,8 +16,8 @@ describe TriggersHelper do
end
end
context
'when worker_next_time > next_run_at'
do
context
'when worker_next_time > next_run_at'
do
let
(
:worker_cron
)
{
'
0 0 1 1 *'
}
# every 00:00
, January 1st
let
(
:worker_cron
)
{
'
1 0 1 1 *'
}
# every 00:01
, January 1st
let
(
:user_cron
)
{
'0
*/6 * * *'
}
# each six hours
let
(
:user_cron
)
{
'0
0 1 1 *'
}
# every 00:00, January 1st
it
'returns worker_next_time'
do
it
'returns worker_next_time'
do
is_expected
.
to
eq
(
Ci
::
CronParser
.
new
(
worker_cron
,
'UTC'
).
next_time_from
(
Time
.
now
))
is_expected
.
to
eq
(
Ci
::
CronParser
.
new
(
worker_cron
,
'UTC'
).
next_time_from
(
Time
.
now
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment