Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
35a7fa59
Commit
35a7fa59
authored
Dec 13, 2013
by
Feanil Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments and documentation to monitor_repo.py
parent
ce4988a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
util/jenkins/monitor_repos.py
+13
-1
No files found.
util/jenkins/monitor_repos.py
View file @
35a7fa59
...
...
@@ -12,18 +12,29 @@ from pymongo import MongoClient, DESCENDING
from
stage_release
import
flip_repos
,
uri_from
def
releases
(
repo
):
"""
Yield a list of all release candidates from the origin.
"""
for
ref
in
repo
.
refs
:
if
ref
.
name
.
startswith
(
'origin/rc/'
):
yield
ref
def
candidates_since
(
repo
,
time
):
"""
Given a repo yield a list of release candidate refs that have a
commit on them after the passed in time
"""
for
rc
in
releases
(
repo
):
last_update
=
datetime
.
utcfromtimestamp
(
rc
.
commit
.
committed_date
)
if
last_update
>
time
:
# New
RC
or updated RC
# New or updated RC
yield
rc
def
stage_release
(
url
,
token
,
repo
,
rc
):
"""
Submit a job to stage a new release for the new rc of the repo.
"""
# Setup the Jenkins params.
params
=
[]
params
.
append
({
'name'
:
"{}_REF"
.
format
(
repo
),
'value'
:
True
})
params
.
append
({
'name'
:
repo
,
'value'
:
rc
.
commit
.
hexsha
})
...
...
@@ -53,6 +64,7 @@ if __name__ == "__main__":
else
:
data
=
{}
# Presist the last time we made this check.
if
'last_check'
not
in
data
:
last_check
=
datetime
.
utcnow
()
else
:
...
...
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