Commit 45598962 authored by Robin Sonnabend's avatar Robin Sonnabend

Add uploading packages

parent 999a5191
Pipeline #582 failed with stage
in 14 minutes and 52 seconds
......@@ -6,13 +6,15 @@ before_script:
- echo "deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list
- sort /etc/apt/sources.list | uniq > sources.list.new
- mv sources.list.new /etc/apt/sources.list
- cat /etc/apt/sources.list
- apt-get update
- apt-get install -y dpkg-dev quilt devscripts
- python3 -m venv venv
- source venv/bin/activate
- pip install wheel
- pip install -r requirements.txt
- mkdir -p ~/.ssh
- echo $DEPLOY_KEY | base64 --decode > ~/.ssh/id_ed25519
- chmod go-rw ~/.ssh/id_ed25519
stages:
- build
......
maintainer:
name: FSMPI Admin-Team
mail: admin@fsmpi.rwth-aachen.de
upload_target: repo@repo.fsmpi.rwth-aachen.de:/srv/repo/incoming/
packages:
- name: adcli
version: 0.8.2-1.1-fsmpi
......
......@@ -67,14 +67,10 @@ def build_package(repo_dir, package_dir, name,
workdir = os.path.join(tempdir, pkg_dir)
print("Content of tempdir:", os.listdir(tempdir))
print("Content of workdir:", os.listdir(workdir))
if additional_content is not None:
print("applying additional content")
for content in additional_content:
target_dir = content["target_dir"]
print("applying", content, "in", target_dir)
os.chdir(os.path.join(workdir, target_dir))
if "patch_dir" in content:
abs_patch_dir = os.path.join(
......@@ -101,7 +97,6 @@ def build_package(repo_dir, package_dir, name,
for entry in _get_log_entries():
run_checked(command + [entry])
print("building")
command = ["apt-get", "build-dep", "-y", name]
run_checked(command)
......@@ -117,6 +112,22 @@ def build_package(repo_dir, package_dir, name,
shutil.move(os.path.join(tempdir, filename), package_dir)
def upload_packages(package_dir, upload_target, key_file=None):
ssh_args = ["ssh", "-o", "StrictHostKeyChecking=no"]
if key_file:
ssh_args.extend(["-i", key_file])
if not package_dir.endswith("/"):
package_dir += "/"
command = [
"rsync",
"--recursive",
"-e", " ".join(ssh_args),
package_dir,
upload_target,
]
run_checked(command)
def main():
repo_dir = os.getcwd()
config = load_config()
......@@ -137,8 +148,11 @@ def main():
os.chdir(repo_dir)
import pprint
print("Built packages:")
pprint.pprint(sorted(os.listdir(package_dir)))
upload_packages(package_dir, config["upload_target"], key_file="~/.ssh/id_ed25519")
if __name__ == "__main__":
main()
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