A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://python-gitlab.readthedocs.org/en/stable/gl_objects/releases.html below:

Releases - python-gitlab v6.2.0

Toggle table of contents sidebar

Releases Project releases Reference Examples

Get a list of releases from a project:

project = gl.projects.get(project_id, lazy=True)
release = project.releases.list(get_all=True)

Get a single release:

release = project.releases.get('v1.2.3')

Edit a release:

release.name = "Demo Release"
release.description = "release notes go here"
release.save()

Create a release for a project tag:

release = project.releases.create({'name':'Demo Release', 'tag_name':'v1.2.3', 'description':'release notes go here'})

Delete a release:

# via its tag name from project attributes
release = project.releases.delete('v1.2.3')

# delete object directly
release.delete()

Note

The Releases API is one of the few working with CI_JOB_TOKEN, but the project can’t be fetched with the token. Thus use lazy for the project as in the above example.

Also be aware that most of the capabilities of the endpoint were not accessible with CI_JOB_TOKEN until Gitlab version 14.5.

Project release links Reference Examples

Get a list of releases from a project:

links = release.links.list()

Get a single release link:

link = release.links.get(1)

Create a release link for a release:

link = release.links.create({"url": "https://example.com/asset", "name": "asset"})

Delete a release link:

# via its ID from release attributes
release.links.delete(1)

# delete object directly
link.delete()

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4