Commit 9bfc1be0 authored by Robin Sonnabend's avatar Robin Sonnabend

Upload built packages as artifacts

parent 5a65b174
Pipeline #494 failed with stage
in 4 minutes and 56 seconds
......@@ -18,3 +18,7 @@ stages:
test:
stage: test
script: scripts/build.py
artifacts:
paths:
- packages
expire_in: 1 day
......@@ -6,6 +6,7 @@ locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
import os
import subprocess as sp
import re
import shutil
import tempfile
import yaml
......@@ -34,7 +35,8 @@ def run_checked(command, **kwargs):
raise
def build_package(repo_dir, name, patch_dir=None, version=None, changelog=None):
def build_package(repo_dir, package_dir, name,
patch_dir=None, version=None, changelog=None):
with tempfile.TemporaryDirectory(dir=os.path.abspath(".")) as tempdir:
os.chdir(tempdir)
result = run_checked(["apt-get", "source", name])
......@@ -82,9 +84,10 @@ def build_package(repo_dir, name, patch_dir=None, version=None, changelog=None):
for filename in os.listdir(tempdir)
if filename.endswith(".deb")
]
print(deb_packages)
#input("Waiting for you, do your thing…")
for filename in os.listdir(tempdir):
if not filename.endswith(".deb"):
continue
shutil.move(os.path.join(tempdir, filename), package_dir)
def main():
......@@ -99,8 +102,11 @@ def main():
if mail:
os.environ["DEBEMAIL"] = mail
package_dir = "packages"
os.makedirs(package_dir, exist_ok=True)
for package in config["packages"]:
build_package(repo_dir=repo_dir, **package)
build_package(repo_dir=repo_dir, package_dir=package_dir, **package)
os.chdir(repo_dir)
......
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