GITLAB_BASE = "https://gitlab.com/api/v4/"
def create_pipeline(project, trigger, data):
- resp = requests.post(f"{GITLAB_BASE}projects/{project}/trigger/pipeline?token={token}", data=data)
+ resp = requests.post("{}projects/{}/trigger/pipeline?token={}".format(GITLAB_BASE, project, token), data=data)
if resp.status_code != 201:
raise Exception("ERROR", req.status_code, req.json())
return resp.json()
build_runner = db.relationship('Runner', backref=db.backref('builds', lazy=True))
def __repr__(self):
- return f"{self.build_id} {self.build_device} {self.build_version} {self.build_type} {self.build_runner_id}"
+ return "{} {} {} {} {}".format(self.build_id, self.build_device, self.build_version, self.build_type, self.build_runner_id)
def as_dict(self):
return {
else:
return
version = version.split("-")[1]
- text = f"LineageOS {version} {state} {device} ({btype})"
+ text = "LineageOS {} {} {} ({})".format(version, state, device, btype)
data = {
"channel": "#releases",
"attachments": [
"fallback": text,
"author_name": "buildbot",
"title": text,
- "text": f"https://gitlab.com/lineageos/builder/android/pipelines/{id_}",
+ "text": "https://gitlab.com/lineageos/builder/android/pipelines/{}".format(id_),
"color": "danger" if status == "failed" else "#020202"
}
]