From affb2b18220bf2dca466e2b101bdeb28187bafc6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 15 Dec 2024 00:15:52 -0800 Subject: [PATCH] Initial commit --- README.org | 3 ++ contexts/.gitkeep | 0 jobs/build-cgit-pygments-wrapper.run | 5 ++++ jobs/build-decker.run | 5 ++++ jobs/build-nroam.run | 18 +++++++++++ jobs/freeloadio.run | 45 ++++++++++++++++++++++++++++ jobs/guile-inkplate.run | 10 +++++++ jobs/update-mirrors-deploy.run | 2 ++ jobs/update-mirrors.run | 5 ++++ scripts/.gitkeep | 0 10 files changed, 93 insertions(+) create mode 100644 README.org create mode 100644 contexts/.gitkeep create mode 100755 jobs/build-cgit-pygments-wrapper.run create mode 100755 jobs/build-decker.run create mode 100755 jobs/build-nroam.run create mode 100755 jobs/freeloadio.run create mode 100755 jobs/guile-inkplate.run create mode 100755 jobs/update-mirrors-deploy.run create mode 100755 jobs/update-mirrors.run create mode 100644 scripts/.gitkeep diff --git a/README.org b/README.org new file mode 100644 index 0000000..3f63fce --- /dev/null +++ b/README.org @@ -0,0 +1,3 @@ +#+title: Build Scripts + +This is my repository of build scripts for my Laminar setup. diff --git a/contexts/.gitkeep b/contexts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/jobs/build-cgit-pygments-wrapper.run b/jobs/build-cgit-pygments-wrapper.run new file mode 100755 index 0000000..06a3d97 --- /dev/null +++ b/jobs/build-cgit-pygments-wrapper.run @@ -0,0 +1,5 @@ +#!/bin/bash -ex +git clone --depth 1 git://ryuslash.org/cgit-pygments-wrapper.git . +makepkg --clean +mv cgit-pygments-wrapper-*-any.pkg.tar.zst "${ARCHIVE}/" +repo-add /home/slash/public_html/repo/x86_64/ryuslash.db.tar.gz "${ARCHIVE}"/cgit-pygments-wrapper-*-any.pkg.tar.zst diff --git a/jobs/build-decker.run b/jobs/build-decker.run new file mode 100755 index 0000000..d12925f --- /dev/null +++ b/jobs/build-decker.run @@ -0,0 +1,5 @@ +#!/bin/bash -ex +git clone --depth 1 git://ryuslash.org/pkgbuilds/decker.git . +makepkg --clean +mv decker-*-x86_64.pkg.tar.zst "${ARCHIVE}/" +repo-add /home/slash/public_html/repo/x86_64/ryuslash.db.tar.gz "${ARCHIVE}"/decker-*-x86_64.pkg.tar.zst diff --git a/jobs/build-nroam.run b/jobs/build-nroam.run new file mode 100755 index 0000000..c493793 --- /dev/null +++ b/jobs/build-nroam.run @@ -0,0 +1,18 @@ +#!/bin/bash -ex +git clone --depth 1 git://ryuslash.org/aliens/nroam.git . + +# Prepare package +version=$(date +%Y%m%d.%-H%M) +dist="nroam-${version}" +mkdir $dist +cp *.el $dist + +## Update version number +pushd $dist +sed -i "s/\\(;; Version: \\).*/\\1${version}/" *.el +echo "(define-package \"nroam\" \"${version}\" \"Org-roam backlinks within org-mode buffers\" '((emacs \"26.1\") (org-roam \"1.2.3\") (org \"9.4.4\"))" \ + > nroam-pkg.el +popd + +tar cf $dist.tar $dist/ +mv $dist.tar "${ARCHIVE}/" diff --git a/jobs/freeloadio.run b/jobs/freeloadio.run new file mode 100755 index 0000000..96d6b48 --- /dev/null +++ b/jobs/freeloadio.run @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +from os import getenv +from os.path import dirname +from re import match +from shlex import quote +from subprocess import run + +commit_before_sha = getenv("CI_COMMIT_BEFORE_SHA") +commit_sha = getenv("CI_COMMIT_SHA") +commit_ref_name = getenv("CI_COMMIT_REF_NAME") +directories = set() +dockerfile_updated = False + +cmd = "git clone https://code.ryuslash.org/ryuslash/git-lfs-test.git ." +print(cmd) +run(cmd, shell=True) + +cmd = "docker images ryuslash.org/freeloadio" +print(cmd) +process = run(cmd, shell=True, capture_output=True) +process_output = process.stdout.decode() + +if len(process_output.strip().split("\n")) == 1: + # We don't have any docker file at all yet. + dockerfile_updated = True + +if not match(r"^0+$", commit_before_sha): + cmd = f"git diff --name-only {quote(commit_before_sha)} {quote(commit_sha)}" + print(cmd) + process = run(cmd, shell=True, capture_output=True) + process_output = process.stdout.decode() + print(process_output) + for filename in process_output.strip().split("\n"): + if filename == "Dockerfile": + dockerfile_updated = True + directories.add(dirname(filename)) + +if dockerfile_updated: + cmd = "docker build -t ryuslash.org/freeloadio:latest ." + print(cmd) + run(cmd, shell=True) + +unix_directory_list = str.join(":", directories) +print(f"python tasks.py probe --directories={quote(unix_directory_list)}") diff --git a/jobs/guile-inkplate.run b/jobs/guile-inkplate.run new file mode 100755 index 0000000..e69b7d8 --- /dev/null +++ b/jobs/guile-inkplate.run @@ -0,0 +1,10 @@ +#!/bin/bash -ex +git clone --depth 1 https://code.ryuslash.org/ryuslash/guile-inkplate.git . +guix shell -D --file=guix.scm <