Submit an OBS request after building and uploading a release.

For OBS request purposes, we consider a commit to be a release
when it is pointed at by at least one commit.
Signed-off-by: Andrej Shadura's avatarAndrew Shadura <andrew.shadura@collabora.co.uk>
Reviewed-by: Sjoerd Simons's avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D6478
parent 35ebe3b6
......@@ -61,6 +61,8 @@
!include-raw-escape: 'scripts/run-build-snapshot.sh'
- shell:
!include-raw-escape: 'scripts/commit-osc-checkout.py'
- shell:
!include-raw-escape: 'scripts/submit-osc-request.py'
publishers:
- email:
recipients: '{maintainers}'
......
#!/usr/bin/python3 -u
# -*- coding: utf-8 -*-
#
# Copyright 2017 Collabora Ltd.
#
# SPDX-License-Identifier: MPL-2.0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
import subprocess
from debian.changelog import Changelog
osc_cmd = ["osc", "-c", os.environ["OSCRC"], 'submitrequest', '--cleanup']
# Parent project
project = ":".join([os.environ["PROJECT"],
os.environ["DISTRO"],
os.environ["COMPONENT"]])
snapshots = ":".join([os.environ["PROJECT"],
os.environ["DISTRO"],
"snapshots"])
package = os.environ["PACKAGE"]
os.chdir(package)
tags = subprocess.check_output(['git', 'tag', '--list', '--points-at', 'HEAD'], universal_newlines=True).strip().splitlines()
if len(tags) < 1:
sys.exit(0)
version = Changelog(file = open('debian/changelog', 'r')).version
subprocess.check_call(osc_cmd + [snapshots, package, project,
'-m', '%s %s' % (package, version)])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment