Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
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
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Merge requests
!1310
Publish links to the release binaries
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Publish links to the release binaries
feature/perm-links
into
dev
Overview
5
Commits
1
Pipelines
0
Changes
2
Merged
Stéphane Veyret
requested to merge
feature/perm-links
into
dev
5 years ago
Overview
5
Commits
1
Pipelines
0
Changes
2
Expand
Closes
#1411 (closed)
Edited
5 years ago
by
Stéphane Veyret
0
0
Merge request reports
Compare
dev
version 8
96afb017
5 years ago
version 7
96afb017
5 years ago
version 6
96afb017
5 years ago
version 5
c277ad64
5 years ago
version 4
0727be27
5 years ago
version 3
0727be27
5 years ago
version 2
9727dfc0
5 years ago
version 1
54b6c388
5 years ago
dev (base)
and
latest version
latest version
3f6fc9a9
1 commit,
5 years ago
version 8
96afb017
1 commit,
5 years ago
version 7
96afb017
1 commit,
5 years ago
version 6
96afb017
1 commit,
5 years ago
version 5
c277ad64
1 commit,
5 years ago
version 4
0727be27
1 commit,
5 years ago
version 3
0727be27
1 commit,
5 years ago
version 2
9727dfc0
1 commit,
5 years ago
version 1
54b6c388
1 commit,
5 years ago
2 files
+
36
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
.gitlab/releaser/releaselinks.py
0 → 100644
+
28
−
0
Options
import
json
import
os
import
urllib.request
from
projectapi
import
ProjectApi
class
ReleaseLinks
(
ProjectApi
):
'''
Release links API.
'''
def
__init__
(
self
):
ProjectApi
.
__init__
(
self
,
'
/releases/{}/assets/links
'
.
format
(
os
.
environ
[
'
CI_COMMIT_TAG
'
]))
def
create_artifact
(
self
,
artifact
):
'''
Create the link for the given artifact.
:param artifact: The artifact data.
:type artifact: dict
'''
send_data
=
{
'
name
'
:
'
{} {} - {}
'
.
format
(
artifact
[
'
category
'
],
artifact
[
'
arch
'
],
artifact
[
'
type
'
]),
'
filepath
'
:
'
/binaries/{}
'
.
format
(
artifact
[
'
name
'
]),
'
url
'
:
artifact
[
'
url
'
]
}
send_data_serialized
=
json
.
dumps
(
send_data
).
encode
(
'
utf-8
'
)
request
=
self
.
build_request
(
data
=
send_data_serialized
,
method
=
'
POST
'
)
request
.
add_header
(
'
Content-Type
'
,
'
application/json
'
)
urllib
.
request
.
urlopen
(
request
)
Loading