Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.admin
Commits
f42a7d39
Commit
f42a7d39
authored
8 years ago
by
Amir Mohammadi
Browse files
Options
Downloads
Patches
Plain Diff
Add chagelog generation script
parent
38fb246e
No related branches found
Branches containing commit
No related tags found
1 merge request
!46
Add chagelog generation script
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nightlies/trigger_pipelines.py
+54
-6
54 additions, 6 deletions
nightlies/trigger_pipelines.py
with
54 additions
and
6 deletions
nightlies/trigger_pipelines.py
+
54
−
6
View file @
f42a7d39
...
...
@@ -91,13 +91,16 @@ class Gitlab(object):
pipeline
=
subprocess
.
check_output
(
cmd
)
return
json
.
loads
(
pipeline
.
decode
())
def
create_merge_request
(
self
,
project_id
,
source_branch
,
target_branch
,
title
,
assignee_id
=
''
,
description
=
''
,
target_project_id
=
''
,
labels
=
''
,
milestone_id
=
''
,
remove_source_branch
=
''
):
def
create_merge_request
(
self
,
project_id
,
source_branch
,
target_branch
,
title
,
assignee_id
=
''
,
description
=
''
,
target_project_id
=
''
,
labels
=
''
,
milestone_id
=
''
,
remove_source_branch
=
''
):
url
=
"
projects/{}/merge_requests?
"
url
+=
"
&
"
.
join
([
'
source_branch={}
'
,
'
target_branch={}
'
,
'
title={}
'
])
url
+=
"
&
"
.
join
([
'
assignee_id={}
'
,
'
description={}
'
,
'
target_project_id={}
'
,
'
labels={}
'
,
'
milestone_id={}
'
,
'
remove_source_branch={}
'
])
url
+=
"
&
"
.
join
(
[
'
source_branch={}
'
,
'
target_branch={}
'
,
'
title={}
'
])
url
+=
"
&
"
.
join
(
[
'
assignee_id={}
'
,
'
description={}
'
,
'
target_project_id={}
'
,
'
labels={}
'
,
'
milestone_id={}
'
,
'
remove_source_branch={}
'
])
url
=
url
.
format
(
project_id
,
source_branch
,
target_branch
,
title
,
assignee_id
,
description
,
target_project_id
,
labels
,
milestone_id
,
remove_source_branch
)
...
...
@@ -107,6 +110,14 @@ class Gitlab(object):
pipeline
=
subprocess
.
check_output
(
cmd
)
return
json
.
loads
(
pipeline
.
decode
())
def
get_tags
(
self
,
project_id
):
cmd
=
[
"
curl
"
,
"
--header
"
,
"
PRIVATE-TOKEN: {}
"
.
format
(
self
.
token
),
self
.
base_url
+
"
projects/{}/repository/tags
"
.
format
(
project_id
)]
pipeline
=
subprocess
.
check_output
(
cmd
)
return
json
.
loads
(
pipeline
.
decode
())
def
main
(
packages_list
):
gitlab
=
Gitlab
(
os
.
environ
.
get
(
'
GITLAB_API_TOKEN
'
))
...
...
@@ -128,6 +139,43 @@ def main(packages_list):
return
def
generate_bob_changelog
():
def
get_changelog
(
pkg
,
tag
):
changelog
=
''
if
tag
[
'
release
'
]
is
None
:
return
changelog
changelog
+=
'
{} {}
\n
'
.
format
(
pkg
,
tag
[
'
name
'
])
changelog
+=
'
{}
\n
'
.
format
(
tag
[
'
release
'
][
'
description
'
])
return
changelog
gitlab
=
Gitlab
(
os
.
environ
.
get
(
'
GITLAB_API_TOKEN
'
))
changelog
=
''
for
package
in
[
'
bob.extension
'
,
'
bob.blitz
'
,
'
bob.core
'
,
'
bob.io.base
'
,
'
bob.sp
'
,
'
bob.ap
'
,
'
bob.math
'
,
'
bob.measure
'
,
'
bob.db.base
'
,
'
bob.io.audio
'
,
'
bob.io.image
'
,
'
bob.io.video
'
,
'
bob.io.matlab
'
,
'
bob.ip.base
'
,
'
bob.ip.color
'
,
'
bob.ip.draw
'
,
'
bob.ip.gabor
'
,
'
bob.learn.activation
'
,
'
bob.learn.libsvm
'
,
'
bob.learn.linear
'
,
'
bob.learn.mlp
'
,
'
bob.learn.em
'
,
'
bob.learn.boosting
'
,
'
bob.db.iris
'
,
'
bob.db.wine
'
,
'
bob.db.mnist
'
,
'
bob.db.atnt
'
,
'
bob.ip.facedetect
'
,
'
bob.ip.optflow.hornschunck
'
,
'
bob.ip.optflow.liu
'
,
'
bob.ip.flandmark
'
,
]:
pid
=
PACKAGES_ID
.
get
(
package
)
if
pid
is
None
:
pid
=
gitlab
.
get_project
(
package
)[
'
id
'
]
print
(
'
Getting tag info for {}
'
.
format
(
package
))
tags
=
gitlab
.
get_tags
(
pid
)
tags
=
sorted
(
tags
,
key
=
lambda
x
:
x
[
'
commit
'
][
'
authored_date
'
])
# if some packages have seen two releases since the last version of
# bob:
# if package in ('bob.io.video', 'bob.ip.gabor'):
# changelog += get_changelog(package, tags[-2])
changelog
+=
get_changelog
(
package
,
tags
[
-
1
])
print
(
changelog
)
if
__name__
==
'
__main__
'
:
arguments
=
docopt
(
__doc__
.
format
(
sys
.
argv
[
0
]),
version
=
'
Nightlies 0.0.1
'
)
print
(
arguments
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment