add ci script

This commit is contained in:
2019-05-30 14:35:35 +02:00
parent 0c8e75e82e
commit dff4090678
3 changed files with 49 additions and 11 deletions

View File

@ -74,7 +74,8 @@ if (releaseInfoFilename):
if 'releaseTagTarget' in releaseInfo:
releaseTagTarget = releaseInfo['releaseTagTarget']
if 'createReleaseTag' in releaseInfo:
createReleaseTag = (releaseInfo['createReleaseTag'] in ('true', 'True'))
createReleaseTag = (releaseInfo['createReleaseTag'] in
('true', 'True'))
if 'description' in releaseInfo:
releaseDescription = releaseInfo['description']
@ -109,14 +110,10 @@ uploadResultJson = json.loads(uploadResult.text)
# --- create release tag
if createReleaseTag:
createReleaseTagUrl = "%s/api/v4//projects/%s/repository/tags" % (instanceUrl, projectId)
headers = {"PRIVATE-TOKEN": privateToken, "Content-Type": "application/json"}
# id (required) - The ID or URL-encoded path of the project owned by the authenticated user
# tag_name (required) - The name of a tag
# ref (required) - Create tag using commit SHA, another tag name, or branch name.
# message (optional) - Creates annotated tag.
# release_description (optional) - Add release notes to the git tag and store it in the GitLab database.
createReleaseTagUrl =
"%s/api/v4//projects/%s/repository/tags" % (instanceUrl, projectId)
headers = {"PRIVATE-TOKEN": privateToken,
"Content-Type": "application/json"}
payloadCreateReleaseTag = {
"tag_name": releaseTag,
@ -125,8 +122,9 @@ if createReleaseTag:
"message": "Tag for release %s" % releaseName
}
createReleaseTagResult = requests.post(createReleaseTagUrl, headers=headers,
data=json.dumps(payloadCreateReleaseTag))
createReleaseTagResult =
requests.post(createReleaseTagUrl, headers=headers,
data=json.dumps(payloadCreateReleaseTag))
if createReleaseTagResult.status_code != 201:
print(createReleaseTagResult)