commit a1c1165aea3a1ccfb4cd06d03825feff9179e2a5
parent 91c7cd5564d57310be418da635d8fc2bce6c540e
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Fri, 11 Sep 2026 23:28:02 +0530
parent 91c7cd5564d57310be418da635d8fc2bce6c540e
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Fri, 11 Sep 2026 23:28:02 +0530
Use minci Jobfile for CI
9 files changed, 252 insertions(+), 801 deletions(-)
M
|
342
+++++++++++++++++++++++++++++++++++++++----------------------------------------
D
|
157
-------------------------------------------------------------------------------
M
|
118
++-----------------------------------------------------------------------------
D
|
287
-------------------------------------------------------------------------------
diff --git a/.config/Jobfile b/.config/Jobfile @@ -0,0 +1,8 @@ +project=foundationpkgs +triggers="refs/heads/main: packages" + +packages() { + FPKGS_ROOT=$srcdir \ + FPKGS_WORK_ROOT=$workdir/fpkgs \ + $srcdir/scripts/fpkgs-ci.sh run "$FETCH_HEAD" +}
diff --git a/AGENTS.md b/AGENTS.md @@ -13,17 +13,17 @@ Read `CONTEXT.md` before changing package names, recipe layout, artifact paths, - Build one recipe: `scripts/build.sh <pkgname-or-path>`. - Convert APKBUILD to pacscript at runtime: `scripts/apkbuild-to-pacscript.sh path/to/APKBUILD`. - Install through pacstall from APKBUILD source: `scripts/pacstall-install.sh <pkgname-or-path>`. -- Plan or run repository CI: `scripts/fpkgs-ci.sh plan [REV]` and `scripts/fpkgs-ci.sh run [REV]`. -- Gitolite integration uses `scripts/fpkgs-ci.sh post-receive`. +- Plan or run repository package work: `scripts/fpkgs-ci.sh plan [REV]` and `scripts/fpkgs-ci.sh run [REV]`. +- CI integration uses minci's runner with `.config/Jobfile`. -See `docs/ci.md` for the deployed bootstrap CI, `docs/minci-handoff.md` for the next provider-neutral Jobfile design, and `docs/ci-architecture.dot` for the CI graph. +See `docs/ci.md` for the deployed minci CI and `docs/ci-architecture.dot` for the CI graph. ## Development rules - Prefer small, detachable scripts with environment-variable configuration over repo-specific hardcoding. - Preserve the build-key contract: changes that affect output must change the key; generated intermediates should not. - Publish artifacts atomically under `$FPKGS_DL_ROOT/<target>/<pkgname>/<pkgver>-r<pkgrel>/<buildkey>/`; expose their public URL with `$FPKGS_DL_BASE_URL`. -- Report package/target outcomes to minci when `FPKGS_MINCI_URL`, `FPKGS_MINCI_KEY`, and `FPKGS_MINCI_SECRET` are set. +- Keep minci reporting in minci; `scripts/fpkgs-ci.sh` should remain package build/publish glue. - When adding a dependency used by an APKBUILD, add an APKBUILD for it when it is not a system/base package. ## Validation before commit
diff --git a/CONTEXT.md b/CONTEXT.md @@ -18,13 +18,13 @@ **Download base URL**: The public URL prefix for artifact manifests; configured as `$FPKGS_DL_BASE_URL`. It currently points at `https://nply.org/dl/foundationpkgs` and can later move to `https://dl.nply.org/foundationpkgs`. -**minci**: The CI report sink and web interface at `ci.nply.org`. It records per-package results; it does not perform package builds. +**minci**: The CI runner, report sink, and web interface at `ci.nply.org`. `minci.sh` runs repository jobs; `minci.cgi` records and displays results. -**Gitolite trigger**: A gitolite hook that observes pushes, filters for `main`, and starts the detachable CI runner. +**Gitolite trigger**: A gitolite hook that observes pushes, filters for `main`, and starts `minci.sh` in the background. -**Bootstrap CI runner**: `scripts/fpkgs-ci.sh`, the current foundationpkgs-specific integration script. It is transitional; the durable direction is to evolve `minci.sh` into the capable runner. +**Package CI helper**: `scripts/fpkgs-ci.sh`, the foundationpkgs-specific package planner/builder/publisher. It is called by `.config/Jobfile`; it does not own CI reporting. -**Jobfile**: A POSIX shell, APKBUILD-like file containing CI metadata variables and job functions. It uses lowercase variables (`project`, `targets`, `triggers`, etc.) and APKBUILD-style `!option` negation. The first implementation is server-level; later repos can provide `.config/Jobfile` on an `integ` branch. +**Jobfile**: A POSIX shell, APKBUILD-like file containing CI metadata variables and job functions. It uses lowercase variables (`project`, `targets`, `triggers`, etc.) and APKBUILD-style `!option` negation. Repositories provide it as `.config/Jobfile`. **Native target**: The target returned by `guess_triplet` for the current build host. The initial deployed CI run builds this target.
diff --git a/docs/ci-architecture.dot b/docs/ci-architecture.dot @@ -2,7 +2,7 @@ digraph foundationpkgs_ci { graph [ rankdir=LR, bgcolor="white", - label="foundationpkgs APKBUILD-first CI on cdg-1", + label="foundationpkgs minci CI on cdg-1", labelloc=t, fontsize=20 ]; @@ -12,17 +12,18 @@ digraph foundationpkgs_ci { subgraph cluster_repo { label="foundationpkgs repository"; color="#cbd5e1"; + jobfile [label=".config/Jobfile\nproject + triggers + jobs", fillcolor="#ccfbf1"]; apkbuild [label="APKBUILD recipes\n(source of truth)", fillcolor="#dbeafe"]; scripts [label="POSIX scripts/\nbuild.sh\nfunctions.sh\napkbuild-to-pacscript.sh\npacstall-install.sh", fillcolor="#e0f2fe"]; - fpkgsci [label="fpkgs-ci.sh\nstandalone CI glue", fillcolor="#ccfbf1"]; + fpkgsci [label="fpkgs-ci.sh\nplan/build/publish helper", fillcolor="#dcfce7"]; } push [label="git push to main", fillcolor="#fef3c7"]; gitolite [label="gitolite post-receive\nfilters refs/heads/main", fillcolor="#fde68a"]; - queue [label="background job\n/var/tmp/fpkgs-ci", fillcolor="#fef9c3"]; + runner [label="minci.sh\nclone/freshen + run Jobfile", fillcolor="#ccfbf1"]; - planner [label="plan REV\nfind applicable recipe buckets\nLinux → Unix → noarch → any", fillcolor="#dcfce7"]; - key [label="build key\nAPKBUILD + local sources/patches\nscripts + target + git rev\nMAKEFLAGS/CFLAGS/LDFLAGS/etc\ntool versions", fillcolor="#bbf7d0"]; + planner [label="plan REV\nrecipe buckets\nLinux → Unix → noarch → any", fillcolor="#dcfce7"]; + key [label="build key\nAPKBUILD + local sources/patches\nscripts + target + git rev\nenvironment + tool versions", fillcolor="#bbf7d0"]; cache [shape=diamond, label="artifact manifest\nalready exists?", fillcolor="#fef2f2"]; builder [label="scripts/build.sh\nfetch → unpack → prepare\ndeps → build → package", fillcolor="#ede9fe"]; @@ -30,13 +31,15 @@ digraph foundationpkgs_ci { publish [label="atomic publish\n$FPKGS_DL_ROOT/<target>/<pkg>/<ver-rrel>/<buildkey>/", fillcolor="#d1fae5"]; dl [label="nply.org/dl now\ndl.nply.org later\nlighttpd static artifacts", fillcolor="#a7f3d0"]; - minci [label="minci report\nci.nply.org/cgi-bin/minci.cgi", fillcolor="#fee2e2"]; + cgi [label="minci.cgi\nrun → job → artifact records", fillcolor="#fee2e2"]; web [label="CI dashboard\nci.nply.org", fillcolor="#fecaca"]; - skipped [label="skip build\nreport success/skip", fillcolor="#e2e8f0"]; + skipped [label="skip build\nalready published", fillcolor="#e2e8f0"]; fail [label="failed build\nbuild.log retained", fillcolor="#fecdd3"]; - push -> gitolite -> queue -> fpkgsci; + push -> gitolite -> runner; + runner -> jobfile; + jobfile -> fpkgsci; fpkgsci -> planner -> key -> cache; cache -> skipped [label="yes"]; cache -> builder [label="no"]; @@ -44,10 +47,8 @@ digraph foundationpkgs_ci { builder -> publish [label="success"]; builder -> fail [label="failure"]; publish -> dl; - publish -> minci [label="success report"]; - skipped -> minci [label="skip report"]; - fail -> minci [label="failure report + log"]; - minci -> web; + runner -> cgi [label="job result + log"]; + cgi -> web; apkbuild -> planner; apkbuild -> builder;
diff --git a/docs/ci-architecture.svg b/docs/ci-architecture.svg @@ -1,275 +1,273 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.42.4 (0) +<!-- Generated by graphviz version 15.1.1 (20260805.0921) --> <!-- Title: foundationpkgs_ci Pages: 1 --> -<svg width="3068pt" height="305pt" - viewBox="0.00 0.00 3068.00 305.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 301)"> +<svg width="2756pt" height="340pt" + viewBox="0.00 0.00 2756.00 340.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 336)"> <title>foundationpkgs_ci</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-301 3064,-301 3064,4 -4,4"/> -<text text-anchor="middle" x="1530" y="-277" font-family="Times,serif" font-size="20.00">foundationpkgs APKBUILD-first CI on cdg-1</text> +<polygon fill="white" stroke="none" points="-4,4 -4,-336 2751.5,-336 2751.5,4 -4,4"/> +<text xml:space="preserve" text-anchor="middle" x="1373.75" y="-309" font-family="Times,serif" font-size="20.00">foundationpkgs minci CI on cdg-1</text> <g id="clust1" class="cluster"> <title>cluster_repo</title> -<polygon fill="white" stroke="#cbd5e1" points="543,-17 543,-259 828,-259 828,-17 543,-17"/> -<text text-anchor="middle" x="685.5" y="-239" font-family="Times,serif" font-size="20.00">foundationpkgs repository</text> +<polygon fill="white" stroke="#cbd5e1" points="616.12,-51.5 616.12,-293.5 1003,-293.5 1003,-51.5 616.12,-51.5"/> +<text xml:space="preserve" text-anchor="middle" x="809.56" y="-270.5" font-family="Times,serif" font-size="20.00">foundationpkgs repository</text> </g> -<!-- apkbuild --> +<!-- jobfile --> <g id="node1" class="node"> +<title>jobfile</title> +<path fill="#ccfbf1" stroke="#334155" d="M770.25,-97.5C770.25,-97.5 636.5,-97.5 636.5,-97.5 630.5,-97.5 624.5,-91.5 624.5,-85.5 624.5,-85.5 624.5,-71.5 624.5,-71.5 624.5,-65.5 630.5,-59.5 636.5,-59.5 636.5,-59.5 770.25,-59.5 770.25,-59.5 776.25,-59.5 782.25,-65.5 782.25,-71.5 782.25,-71.5 782.25,-85.5 782.25,-85.5 782.25,-91.5 776.25,-97.5 770.25,-97.5"/> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-80.2" font-family="Helvetica,sans-Serif" font-size="14.00">.config/Jobfile</text> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-65.2" font-family="Helvetica,sans-Serif" font-size="14.00">project + triggers + jobs</text> +</g> +<!-- fpkgsci --> +<g id="node4" class="node"> +<title>fpkgsci</title> +<path fill="#dcfce7" stroke="#334155" d="M983,-97.5C983,-97.5 845.5,-97.5 845.5,-97.5 839.5,-97.5 833.5,-91.5 833.5,-85.5 833.5,-85.5 833.5,-71.5 833.5,-71.5 833.5,-65.5 839.5,-59.5 845.5,-59.5 845.5,-59.5 983,-59.5 983,-59.5 989,-59.5 995,-65.5 995,-71.5 995,-71.5 995,-85.5 995,-85.5 995,-91.5 989,-97.5 983,-97.5"/> +<text xml:space="preserve" text-anchor="middle" x="914.25" y="-80.2" font-family="Helvetica,sans-Serif" font-size="14.00">fpkgs-ci.sh</text> +<text xml:space="preserve" text-anchor="middle" x="914.25" y="-65.2" font-family="Helvetica,sans-Serif" font-size="14.00">plan/build/publish helper</text> +</g> +<!-- jobfile->fpkgsci --> +<g id="edge4" class="edge"> +<title>jobfile->fpkgsci</title> +<path fill="none" stroke="#475569" d="M782.75,-78.5C795.46,-78.5 808.72,-78.5 821.72,-78.5"/> +<polygon fill="#475569" stroke="#475569" points="821.53,-82 831.53,-78.5 821.53,-75 821.53,-82"/> +</g> +<!-- apkbuild --> +<g id="node2" class="node"> <title>apkbuild</title> -<path fill="#dbeafe" stroke="#334155" d="M743,-221C743,-221 627,-221 627,-221 621,-221 615,-215 615,-209 615,-209 615,-195 615,-195 615,-189 621,-183 627,-183 627,-183 743,-183 743,-183 749,-183 755,-189 755,-195 755,-195 755,-209 755,-209 755,-215 749,-221 743,-221"/> -<text text-anchor="middle" x="685" y="-205.8" font-family="Helvetica,sans-Serif" font-size="14.00">APKBUILD recipes</text> -<text text-anchor="middle" x="685" y="-190.8" font-family="Helvetica,sans-Serif" font-size="14.00">(source of truth)</text> +<path fill="#dbeafe" stroke="#334155" d="M756.38,-153.5C756.38,-153.5 650.38,-153.5 650.38,-153.5 644.38,-153.5 638.38,-147.5 638.38,-141.5 638.38,-141.5 638.38,-127.5 638.38,-127.5 638.38,-121.5 644.38,-115.5 650.38,-115.5 650.38,-115.5 756.38,-115.5 756.38,-115.5 762.38,-115.5 768.38,-121.5 768.38,-127.5 768.38,-127.5 768.38,-141.5 768.38,-141.5 768.38,-147.5 762.38,-153.5 756.38,-153.5"/> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-136.2" font-family="Helvetica,sans-Serif" font-size="14.00">APKBUILD recipes</text> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-121.2" font-family="Helvetica,sans-Serif" font-size="14.00">(source of truth)</text> </g> <!-- planner --> -<g id="node7" class="node"> +<g id="node8" class="node"> <title>planner</title> -<path fill="#dcfce7" stroke="#334155" d="M1069,-173.5C1069,-173.5 869,-173.5 869,-173.5 863,-173.5 857,-167.5 857,-161.5 857,-161.5 857,-132.5 857,-132.5 857,-126.5 863,-120.5 869,-120.5 869,-120.5 1069,-120.5 1069,-120.5 1075,-120.5 1081,-126.5 1081,-132.5 1081,-132.5 1081,-161.5 1081,-161.5 1081,-167.5 1075,-173.5 1069,-173.5"/> -<text text-anchor="middle" x="969" y="-158.3" font-family="Helvetica,sans-Serif" font-size="14.00">plan REV</text> -<text text-anchor="middle" x="969" y="-143.3" font-family="Helvetica,sans-Serif" font-size="14.00">find applicable recipe buckets</text> -<text text-anchor="middle" x="969" y="-128.3" font-family="Helvetica,sans-Serif" font-size="14.00">Linux → Unix → noarch → any</text> +<path fill="#dcfce7" stroke="#334155" d="M1223.5,-127.5C1223.5,-127.5 1044,-127.5 1044,-127.5 1038,-127.5 1032,-121.5 1032,-115.5 1032,-115.5 1032,-83.5 1032,-83.5 1032,-77.5 1038,-71.5 1044,-71.5 1044,-71.5 1223.5,-71.5 1223.5,-71.5 1229.5,-71.5 1235.5,-77.5 1235.5,-83.5 1235.5,-83.5 1235.5,-115.5 1235.5,-115.5 1235.5,-121.5 1229.5,-127.5 1223.5,-127.5"/> +<text xml:space="preserve" text-anchor="middle" x="1133.75" y="-110.2" font-family="Helvetica,sans-Serif" font-size="14.00">plan REV</text> +<text xml:space="preserve" text-anchor="middle" x="1133.75" y="-95.2" font-family="Helvetica,sans-Serif" font-size="14.00">recipe buckets</text> +<text xml:space="preserve" text-anchor="middle" x="1133.75" y="-80.2" font-family="Helvetica,sans-Serif" font-size="14.00">Linux → Unix → noarch → any</text> </g> <!-- apkbuild->planner --> -<g id="edge17" class="edge"> +<g id="edge16" class="edge"> <title>apkbuild->planner</title> -<path fill="none" stroke="#475569" d="M755.35,-188.48C782.94,-183.09 815.52,-176.74 846.77,-170.64"/> -<polygon fill="#475569" stroke="#475569" points="847.72,-174.03 856.86,-168.68 846.38,-167.15 847.72,-174.03"/> +<path fill="none" stroke="#475569" d="M768.51,-129.26C835.05,-123.82 940.42,-115.21 1020.75,-108.65"/> +<polygon fill="#475569" stroke="#475569" points="1020.72,-112.17 1030.4,-107.86 1020.15,-105.19 1020.72,-112.17"/> </g> <!-- builder --> -<g id="node10" class="node"> +<g id="node11" class="node"> <title>builder</title> -<path fill="#ede9fe" stroke="#334155" d="M1913,-155.5C1913,-155.5 1739,-155.5 1739,-155.5 1733,-155.5 1727,-149.5 1727,-143.5 1727,-143.5 1727,-114.5 1727,-114.5 1727,-108.5 1733,-102.5 1739,-102.5 1739,-102.5 1913,-102.5 1913,-102.5 1919,-102.5 1925,-108.5 1925,-114.5 1925,-114.5 1925,-143.5 1925,-143.5 1925,-149.5 1919,-155.5 1913,-155.5"/> -<text text-anchor="middle" x="1826" y="-140.3" font-family="Helvetica,sans-Serif" font-size="14.00">scripts/build.sh</text> -<text text-anchor="middle" x="1826" y="-125.3" font-family="Helvetica,sans-Serif" font-size="14.00">fetch → unpack → prepare</text> -<text text-anchor="middle" x="1826" y="-110.3" font-family="Helvetica,sans-Serif" font-size="14.00">deps → build → package</text> +<path fill="#ede9fe" stroke="#334155" d="M1980.25,-194C1980.25,-194 1825.5,-194 1825.5,-194 1819.5,-194 1813.5,-188 1813.5,-182 1813.5,-182 1813.5,-147 1813.5,-147 1813.5,-141 1819.5,-135 1825.5,-135 1825.5,-135 1980.25,-135 1980.25,-135 1986.25,-135 1992.25,-141 1992.25,-147 1992.25,-147 1992.25,-182 1992.25,-182 1992.25,-188 1986.25,-194 1980.25,-194"/> +<text xml:space="preserve" text-anchor="middle" x="1902.88" y="-176.7" font-family="Helvetica,sans-Serif" font-size="14.00">scripts/build.sh</text> +<text xml:space="preserve" text-anchor="middle" x="1902.88" y="-161.7" font-family="Helvetica,sans-Serif" font-size="14.00">fetch → unpack → prepare</text> +<text xml:space="preserve" text-anchor="middle" x="1902.88" y="-143.7" font-family="Helvetica,sans-Serif" font-size="14.00">deps → build → package</text> </g> <!-- apkbuild->builder --> -<g id="edge18" class="edge"> +<g id="edge17" class="edge"> <title>apkbuild->builder</title> -<path fill="none" stroke="#475569" d="M755.24,-202C812.33,-202 895.42,-202 968,-202 968,-202 968,-202 1543,-202 1615.43,-202 1695.07,-179.15 1751.2,-159.02"/> -<polygon fill="#475569" stroke="#475569" points="1752.5,-162.27 1760.69,-155.56 1750.1,-155.7 1752.5,-162.27"/> +<path fill="none" stroke="#475569" d="M768.51,-148.07C809.67,-155.61 864.37,-163.5 913.25,-163.5 913.25,-163.5 913.25,-163.5 1650.75,-163.5 1700.49,-163.5 1755.77,-163.7 1801.77,-163.92"/> +<polygon fill="#475569" stroke="#475569" points="1801.73,-167.42 1811.74,-163.97 1801.76,-160.42 1801.73,-167.42"/> </g> <!-- scripts --> -<g id="node2" class="node"> +<g id="node3" class="node"> <title>scripts</title> -<path fill="#e0f2fe" stroke="#334155" d="M766,-108.5C766,-108.5 604,-108.5 604,-108.5 598,-108.5 592,-102.5 592,-96.5 592,-96.5 592,-37.5 592,-37.5 592,-31.5 598,-25.5 604,-25.5 604,-25.5 766,-25.5 766,-25.5 772,-25.5 778,-31.5 778,-37.5 778,-37.5 778,-96.5 778,-96.5 778,-102.5 772,-108.5 766,-108.5"/> -<text text-anchor="middle" x="685" y="-93.3" font-family="Helvetica,sans-Serif" font-size="14.00">POSIX scripts/</text> -<text text-anchor="middle" x="685" y="-78.3" font-family="Helvetica,sans-Serif" font-size="14.00">build.sh</text> -<text text-anchor="middle" x="685" y="-63.3" font-family="Helvetica,sans-Serif" font-size="14.00">functions.sh</text> -<text text-anchor="middle" x="685" y="-48.3" font-family="Helvetica,sans-Serif" font-size="14.00">apkbuild-to-pacscript.sh</text> -<text text-anchor="middle" x="685" y="-33.3" font-family="Helvetica,sans-Serif" font-size="14.00">pacstall-install.sh</text> +<path fill="#e0f2fe" stroke="#334155" d="M770.62,-255C770.62,-255 636.12,-255 636.12,-255 630.12,-255 624.12,-249 624.12,-243 624.12,-243 624.12,-184 624.12,-184 624.12,-178 630.12,-172 636.12,-172 636.12,-172 770.62,-172 770.62,-172 776.62,-172 782.62,-178 782.62,-184 782.62,-184 782.62,-243 782.62,-243 782.62,-249 776.62,-255 770.62,-255"/> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-237.7" font-family="Helvetica,sans-Serif" font-size="14.00">POSIX scripts/</text> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-222.7" font-family="Helvetica,sans-Serif" font-size="14.00">build.sh</text> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-207.7" font-family="Helvetica,sans-Serif" font-size="14.00">functions.sh</text> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-192.7" font-family="Helvetica,sans-Serif" font-size="14.00">apkbuild-to-pacscript.sh</text> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-177.7" font-family="Helvetica,sans-Serif" font-size="14.00">pacstall-install.sh</text> </g> <!-- key --> -<g id="node8" class="node"> +<g id="node9" class="node"> <title>key</title> -<path fill="#bbf7d0" stroke="#334155" d="M1362,-169.5C1362,-169.5 1130,-169.5 1130,-169.5 1124,-169.5 1118,-163.5 1118,-157.5 1118,-157.5 1118,-98.5 1118,-98.5 1118,-92.5 1124,-86.5 1130,-86.5 1130,-86.5 1362,-86.5 1362,-86.5 1368,-86.5 1374,-92.5 1374,-98.5 1374,-98.5 1374,-157.5 1374,-157.5 1374,-163.5 1368,-169.5 1362,-169.5"/> -<text text-anchor="middle" x="1246" y="-154.3" font-family="Helvetica,sans-Serif" font-size="14.00">build key</text> -<text text-anchor="middle" x="1246" y="-139.3" font-family="Helvetica,sans-Serif" font-size="14.00">APKBUILD + local sources/patches</text> -<text text-anchor="middle" x="1246" y="-124.3" font-family="Helvetica,sans-Serif" font-size="14.00">scripts + target + git rev</text> -<text text-anchor="middle" x="1246" y="-109.3" font-family="Helvetica,sans-Serif" font-size="14.00">MAKEFLAGS/CFLAGS/LDFLAGS/etc</text> -<text text-anchor="middle" x="1246" y="-94.3" font-family="Helvetica,sans-Serif" font-size="14.00">tool versions</text> +<path fill="#bbf7d0" stroke="#334155" d="M1488.75,-133.5C1488.75,-133.5 1284.5,-133.5 1284.5,-133.5 1278.5,-133.5 1272.5,-127.5 1272.5,-121.5 1272.5,-121.5 1272.5,-77.5 1272.5,-77.5 1272.5,-71.5 1278.5,-65.5 1284.5,-65.5 1284.5,-65.5 1488.75,-65.5 1488.75,-65.5 1494.75,-65.5 1500.75,-71.5 1500.75,-77.5 1500.75,-77.5 1500.75,-121.5 1500.75,-121.5 1500.75,-127.5 1494.75,-133.5 1488.75,-133.5"/> +<text xml:space="preserve" text-anchor="middle" x="1386.62" y="-116.2" font-family="Helvetica,sans-Serif" font-size="14.00">build key</text> +<text xml:space="preserve" text-anchor="middle" x="1386.62" y="-101.2" font-family="Helvetica,sans-Serif" font-size="14.00">APKBUILD + local sources/patches</text> +<text xml:space="preserve" text-anchor="middle" x="1386.62" y="-86.2" font-family="Helvetica,sans-Serif" font-size="14.00">scripts + target + git rev</text> +<text xml:space="preserve" text-anchor="middle" x="1386.62" y="-71.2" font-family="Helvetica,sans-Serif" font-size="14.00">environment + tool versions</text> </g> <!-- scripts->key --> -<g id="edge20" class="edge"> +<g id="edge19" class="edge"> <title>scripts->key</title> -<path fill="none" stroke="#475569" d="M778.31,-77.07C867.96,-86.86 1005.18,-101.83 1107.66,-113.01"/> -<polygon fill="#475569" stroke="#475569" points="1107.45,-116.51 1117.77,-114.12 1108.21,-109.55 1107.45,-116.51"/> +<path fill="none" stroke="#475569" d="M782.83,-205.85C845.53,-199.38 935.6,-189.3 1014,-177.5 1113,-162.6 1137.63,-157.6 1235.5,-136.5 1243.89,-134.69 1252.54,-132.75 1261.23,-130.75"/> +<polygon fill="#475569" stroke="#475569" points="1261.84,-134.21 1270.78,-128.53 1260.25,-127.39 1261.84,-134.21"/> </g> <!-- scripts->builder --> -<g id="edge19" class="edge"> +<g id="edge18" class="edge"> <title>scripts->builder</title> -<path fill="none" stroke="#475569" d="M778.03,-60.61C833.11,-57.33 904.53,-54 968,-54 968,-54 968,-54 1543,-54 1616.39,-54 1697.03,-78.02 1753.2,-98.87"/> -<polygon fill="#475569" stroke="#475569" points="1752.11,-102.2 1762.7,-102.45 1754.58,-95.65 1752.11,-102.2"/> -</g> -<!-- fpkgsci --> -<g id="node3" class="node"> -<title>fpkgsci</title> -<path fill="#ccfbf1" stroke="#334155" d="M746,-165C746,-165 624,-165 624,-165 618,-165 612,-159 612,-153 612,-153 612,-139 612,-139 612,-133 618,-127 624,-127 624,-127 746,-127 746,-127 752,-127 758,-133 758,-139 758,-139 758,-153 758,-153 758,-159 752,-165 746,-165"/> -<text text-anchor="middle" x="685" y="-149.8" font-family="Helvetica,sans-Serif" font-size="14.00">fpkgs-ci.sh</text> -<text text-anchor="middle" x="685" y="-134.8" font-family="Helvetica,sans-Serif" font-size="14.00">standalone CI glue</text> +<path fill="none" stroke="#475569" d="M782.94,-227.94C821.98,-233.93 869.95,-239.5 913.25,-239.5 913.25,-239.5 913.25,-239.5 1650.75,-239.5 1712.32,-239.5 1778.97,-218.54 1828.12,-198.79"/> +<polygon fill="#475569" stroke="#475569" points="1829.33,-202.07 1837.25,-195.04 1826.67,-195.6 1829.33,-202.07"/> </g> <!-- fpkgsci->planner --> -<g id="edge4" class="edge"> +<g id="edge5" class="edge"> <title>fpkgsci->planner</title> -<path fill="none" stroke="#475569" d="M758.26,-146.26C785.16,-146.35 816.48,-146.46 846.59,-146.57"/> -<polygon fill="#475569" stroke="#475569" points="846.74,-150.07 856.75,-146.61 846.76,-143.07 846.74,-150.07"/> +<path fill="none" stroke="#475569" d="M995.31,-86.23C1003.57,-87.03 1012.06,-87.85 1020.58,-88.67"/> +<polygon fill="#475569" stroke="#475569" points="1019.98,-92.13 1030.27,-89.61 1020.65,-85.16 1019.98,-92.13"/> </g> <!-- push --> -<g id="node4" class="node"> +<g id="node5" class="node"> <title>push</title> -<path fill="#fef3c7" stroke="#334155" d="M119,-164C119,-164 12,-164 12,-164 6,-164 0,-158 0,-152 0,-152 0,-140 0,-140 0,-134 6,-128 12,-128 12,-128 119,-128 119,-128 125,-128 131,-134 131,-140 131,-140 131,-152 131,-152 131,-158 125,-164 119,-164"/> -<text text-anchor="middle" x="65.5" y="-142.3" font-family="Helvetica,sans-Serif" font-size="14.00">git push to main</text> +<path fill="#fef3c7" stroke="#334155" d="M100,-67.5C100,-67.5 12,-67.5 12,-67.5 6,-67.5 0,-61.5 0,-55.5 0,-55.5 0,-43.5 0,-43.5 0,-37.5 6,-31.5 12,-31.5 12,-31.5 100,-31.5 100,-31.5 106,-31.5 112,-37.5 112,-43.5 112,-43.5 112,-55.5 112,-55.5 112,-61.5 106,-67.5 100,-67.5"/> +<text xml:space="preserve" text-anchor="middle" x="56" y="-43.7" font-family="Helvetica,sans-Serif" font-size="14.00">git push to main</text> </g> <!-- gitolite --> -<g id="node5" class="node"> +<g id="node6" class="node"> <title>gitolite</title> -<path fill="#fde68a" stroke="#334155" d="M329,-165C329,-165 180,-165 180,-165 174,-165 168,-159 168,-153 168,-153 168,-139 168,-139 168,-133 174,-127 180,-127 180,-127 329,-127 329,-127 335,-127 341,-133 341,-139 341,-139 341,-153 341,-153 341,-159 335,-165 329,-165"/> -<text text-anchor="middle" x="254.5" y="-149.8" font-family="Helvetica,sans-Serif" font-size="14.00">gitolite post-receive</text> -<text text-anchor="middle" x="254.5" y="-134.8" font-family="Helvetica,sans-Serif" font-size="14.00">filters refs/heads/main</text> +<path fill="#fde68a" stroke="#334155" d="M285.75,-68.5C285.75,-68.5 161,-68.5 161,-68.5 155,-68.5 149,-62.5 149,-56.5 149,-56.5 149,-42.5 149,-42.5 149,-36.5 155,-30.5 161,-30.5 161,-30.5 285.75,-30.5 285.75,-30.5 291.75,-30.5 297.75,-36.5 297.75,-42.5 297.75,-42.5 297.75,-56.5 297.75,-56.5 297.75,-62.5 291.75,-68.5 285.75,-68.5"/> +<text xml:space="preserve" text-anchor="middle" x="223.38" y="-51.2" font-family="Helvetica,sans-Serif" font-size="14.00">gitolite post-receive</text> +<text xml:space="preserve" text-anchor="middle" x="223.38" y="-36.2" font-family="Helvetica,sans-Serif" font-size="14.00">filters refs/heads/main</text> </g> <!-- push->gitolite --> <g id="edge1" class="edge"> <title>push->gitolite</title> -<path fill="none" stroke="#475569" d="M131.12,-146C139.71,-146 148.66,-146 157.64,-146"/> -<polygon fill="#475569" stroke="#475569" points="157.77,-149.5 167.77,-146 157.77,-142.5 157.77,-149.5"/> +<path fill="none" stroke="#475569" d="M112.07,-49.5C120.23,-49.5 128.81,-49.5 137.41,-49.5"/> +<polygon fill="#475569" stroke="#475569" points="137.2,-53 147.2,-49.5 137.2,-46 137.2,-53"/> </g> -<!-- queue --> -<g id="node6" class="node"> -<title>queue</title> -<path fill="#fef9c3" stroke="#334155" d="M502,-165C502,-165 390,-165 390,-165 384,-165 378,-159 378,-153 378,-153 378,-139 378,-139 378,-133 384,-127 390,-127 390,-127 502,-127 502,-127 508,-127 514,-133 514,-139 514,-139 514,-153 514,-153 514,-159 508,-165 502,-165"/> -<text text-anchor="middle" x="446" y="-149.8" font-family="Helvetica,sans-Serif" font-size="14.00">background job</text> -<text text-anchor="middle" x="446" y="-134.8" font-family="Helvetica,sans-Serif" font-size="14.00">/var/tmp/fpkgs-ci</text> +<!-- runner --> +<g id="node7" class="node"> +<title>runner</title> +<path fill="#ccfbf1" stroke="#334155" d="M497.75,-68.5C497.75,-68.5 346.75,-68.5 346.75,-68.5 340.75,-68.5 334.75,-62.5 334.75,-56.5 334.75,-56.5 334.75,-42.5 334.75,-42.5 334.75,-36.5 340.75,-30.5 346.75,-30.5 346.75,-30.5 497.75,-30.5 497.75,-30.5 503.75,-30.5 509.75,-36.5 509.75,-42.5 509.75,-42.5 509.75,-56.5 509.75,-56.5 509.75,-62.5 503.75,-68.5 497.75,-68.5"/> +<text xml:space="preserve" text-anchor="middle" x="422.25" y="-51.2" font-family="Helvetica,sans-Serif" font-size="14.00">minci.sh</text> +<text xml:space="preserve" text-anchor="middle" x="422.25" y="-36.2" font-family="Helvetica,sans-Serif" font-size="14.00">clone/freshen + run Jobfile</text> </g> -<!-- gitolite->queue --> +<!-- gitolite->runner --> <g id="edge2" class="edge"> -<title>gitolite->queue</title> -<path fill="none" stroke="#475569" d="M341.1,-146C349.99,-146 358.98,-146 367.76,-146"/> -<polygon fill="#475569" stroke="#475569" points="367.96,-149.5 377.96,-146 367.95,-142.5 367.96,-149.5"/> +<title>gitolite->runner</title> +<path fill="none" stroke="#475569" d="M298.24,-49.5C306.35,-49.5 314.68,-49.5 323.02,-49.5"/> +<polygon fill="#475569" stroke="#475569" points="322.85,-53 332.85,-49.5 322.85,-46 322.85,-53"/> </g> -<!-- queue->fpkgsci --> +<!-- runner->jobfile --> <g id="edge3" class="edge"> -<title>queue->fpkgsci</title> -<path fill="none" stroke="#475569" d="M514.28,-146C541.46,-146 573.09,-146 601.63,-146"/> -<polygon fill="#475569" stroke="#475569" points="601.99,-149.5 611.99,-146 601.99,-142.5 601.99,-149.5"/> +<title>runner->jobfile</title> +<path fill="none" stroke="#475569" d="M510.04,-58.52C542.68,-61.91 579.83,-65.77 612.73,-69.19"/> +<polygon fill="#475569" stroke="#475569" points="612.36,-72.67 622.67,-70.22 613.08,-65.7 612.36,-72.67"/> +</g> +<!-- cgi --> +<g id="node15" class="node"> +<title>cgi</title> +<path fill="#fee2e2" stroke="#334155" d="M784.5,-41C784.5,-41 622.25,-41 622.25,-41 616.25,-41 610.25,-35 610.25,-29 610.25,-29 610.25,-12 610.25,-12 610.25,-6 616.25,0 622.25,0 622.25,0 784.5,0 784.5,0 790.5,0 796.5,-6 796.5,-12 796.5,-12 796.5,-29 796.5,-29 796.5,-35 790.5,-41 784.5,-41"/> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-23.7" font-family="Helvetica,sans-Serif" font-size="14.00">minci.cgi</text> +<text xml:space="preserve" text-anchor="middle" x="703.38" y="-8.7" font-family="Helvetica,sans-Serif" font-size="14.00">run → job → artifact records</text> +</g> +<!-- runner->cgi --> +<g id="edge14" class="edge"> +<title>runner->cgi</title> +<path fill="none" stroke="#475569" d="M510.04,-40.48C538.13,-37.56 569.58,-34.3 598.77,-31.26"/> +<polygon fill="#475569" stroke="#475569" points="598.75,-34.79 608.33,-30.27 598.02,-27.82 598.75,-34.79"/> +<text xml:space="preserve" text-anchor="middle" x="560" y="-40.2" font-family="Helvetica,sans-Serif" font-size="10.00">job result + log</text> </g> <!-- planner->key --> -<g id="edge5" class="edge"> +<g id="edge6" class="edge"> <title>planner->key</title> -<path fill="none" stroke="#475569" d="M1081.06,-139.33C1089.83,-138.72 1098.76,-138.1 1107.68,-137.49"/> -<polygon fill="#475569" stroke="#475569" points="1108.01,-140.97 1117.74,-136.79 1107.52,-133.99 1108.01,-140.97"/> +<path fill="none" stroke="#475569" d="M1235.71,-99.5C1243.94,-99.5 1252.33,-99.5 1260.71,-99.5"/> +<polygon fill="#475569" stroke="#475569" points="1260.61,-103 1270.61,-99.5 1260.61,-96 1260.61,-103"/> </g> <!-- cache --> -<g id="node9" class="node"> +<g id="node10" class="node"> <title>cache</title> -<path fill="#fef2f2" stroke="#334155" d="M1530.48,-162.66C1530.48,-162.66 1422.52,-131.34 1422.52,-131.34 1416.76,-129.67 1416.76,-126.33 1422.52,-124.66 1422.52,-124.66 1530.48,-93.34 1530.48,-93.34 1536.24,-91.67 1547.76,-91.67 1553.52,-93.34 1553.52,-93.34 1661.48,-124.66 1661.48,-124.66 1667.24,-126.33 1667.24,-129.67 1661.48,-131.34 1661.48,-131.34 1553.52,-162.66 1553.52,-162.66 1547.76,-164.33 1536.24,-164.33 1530.48,-162.66"/> -<text text-anchor="middle" x="1542" y="-131.8" font-family="Helvetica,sans-Serif" font-size="14.00">artifact manifest</text> -<text text-anchor="middle" x="1542" y="-116.8" font-family="Helvetica,sans-Serif" font-size="14.00">already exists?</text> +<path fill="#fef2f2" stroke="#334155" d="M1638.39,-131.64C1638.39,-131.64 1549.11,-101.36 1549.11,-101.36 1543.43,-99.43 1543.43,-95.57 1549.11,-93.64 1549.11,-93.64 1638.39,-63.36 1638.39,-63.36 1644.07,-61.43 1655.43,-61.43 1661.11,-63.36 1661.11,-63.36 1750.39,-93.64 1750.39,-93.64 1756.07,-95.57 1756.07,-99.43 1750.39,-101.36 1750.39,-101.36 1661.11,-131.64 1661.11,-131.64 1655.43,-133.57 1644.07,-133.57 1638.39,-131.64"/> +<text xml:space="preserve" text-anchor="middle" x="1649.75" y="-99.2" font-family="Helvetica,sans-Serif" font-size="14.00">artifact manifest</text> +<text xml:space="preserve" text-anchor="middle" x="1649.75" y="-84.2" font-family="Helvetica,sans-Serif" font-size="14.00">already exists?</text> </g> <!-- key->cache --> -<g id="edge6" class="edge"> +<g id="edge7" class="edge"> <title>key->cache</title> -<path fill="none" stroke="#475569" d="M1374.24,-128C1382.94,-128 1391.74,-128 1400.5,-128"/> -<polygon fill="#475569" stroke="#475569" points="1400.77,-131.5 1410.77,-128 1400.77,-124.5 1400.77,-131.5"/> +<path fill="none" stroke="#475569" d="M1501.02,-98.63C1509.73,-98.56 1518.54,-98.5 1527.3,-98.43"/> +<polygon fill="#475569" stroke="#475569" points="1527.28,-101.93 1537.25,-98.35 1527.23,-94.93 1527.28,-101.93"/> </g> <!-- cache->builder --> -<g id="edge8" class="edge"> +<g id="edge9" class="edge"> <title>cache->builder</title> -<path fill="none" stroke="#475569" d="M1671.62,-128.46C1686.73,-128.51 1702.03,-128.56 1716.82,-128.62"/> -<polygon fill="#475569" stroke="#475569" points="1716.95,-132.12 1726.96,-128.65 1716.98,-125.12 1716.95,-132.12"/> -<text text-anchor="middle" x="1700" y="-132" font-family="Helvetica,sans-Serif" font-size="10.00">no</text> +<path fill="none" stroke="#475569" d="M1713.47,-114.23C1740.38,-121.41 1772.49,-129.98 1802.5,-137.99"/> +<polygon fill="#475569" stroke="#475569" points="1801.42,-141.32 1811.99,-140.52 1803.23,-134.56 1801.42,-141.32"/> +<text xml:space="preserve" text-anchor="middle" x="1787.62" y="-136.76" font-family="Helvetica,sans-Serif" font-size="10.00">no</text> </g> <!-- skipped --> -<g id="node16" class="node"> +<g id="node17" class="node"> <title>skipped</title> -<path fill="#e2e8f0" stroke="#334155" d="M1889.5,-38C1889.5,-38 1762.5,-38 1762.5,-38 1756.5,-38 1750.5,-32 1750.5,-26 1750.5,-26 1750.5,-12 1750.5,-12 1750.5,-6 1756.5,0 1762.5,0 1762.5,0 1889.5,0 1889.5,0 1895.5,0 1901.5,-6 1901.5,-12 1901.5,-12 1901.5,-26 1901.5,-26 1901.5,-32 1895.5,-38 1889.5,-38"/> -<text text-anchor="middle" x="1826" y="-22.8" font-family="Helvetica,sans-Serif" font-size="14.00">skip build</text> -<text text-anchor="middle" x="1826" y="-7.8" font-family="Helvetica,sans-Serif" font-size="14.00">report success/skip</text> +<path fill="#e2e8f0" stroke="#334155" d="M1951.75,-116.5C1951.75,-116.5 1854,-116.5 1854,-116.5 1848,-116.5 1842,-110.5 1842,-104.5 1842,-104.5 1842,-90.5 1842,-90.5 1842,-84.5 1848,-78.5 1854,-78.5 1854,-78.5 1951.75,-78.5 1951.75,-78.5 1957.75,-78.5 1963.75,-84.5 1963.75,-90.5 1963.75,-90.5 1963.75,-104.5 1963.75,-104.5 1963.75,-110.5 1957.75,-116.5 1951.75,-116.5"/> +<text xml:space="preserve" text-anchor="middle" x="1902.88" y="-99.2" font-family="Helvetica,sans-Serif" font-size="14.00">skip build</text> +<text xml:space="preserve" text-anchor="middle" x="1902.88" y="-84.2" font-family="Helvetica,sans-Serif" font-size="14.00">already published</text> </g> <!-- cache->skipped --> -<g id="edge7" class="edge"> +<g id="edge8" class="edge"> <title>cache->skipped</title> -<path fill="none" stroke="#475569" d="M1599.05,-106.33C1647.39,-87.65 1716.96,-60.76 1766.11,-41.76"/> -<polygon fill="#475569" stroke="#475569" points="1767.59,-44.94 1775.65,-38.07 1765.07,-38.41 1767.59,-44.94"/> -<text text-anchor="middle" x="1700" y="-74" font-family="Helvetica,sans-Serif" font-size="10.00">yes</text> +<path fill="none" stroke="#475569" d="M1763.09,-97.5C1785.9,-97.5 1809.3,-97.5 1830.23,-97.5"/> +<polygon fill="#475569" stroke="#475569" points="1830.07,-101 1840.07,-97.5 1830.07,-94 1830.07,-101"/> +<text xml:space="preserve" text-anchor="middle" x="1787.62" y="-99.25" font-family="Helvetica,sans-Serif" font-size="10.00">yes</text> </g> <!-- pacstall --> -<g id="node11" class="node"> +<g id="node12" class="node"> <title>pacstall</title> -<path fill="#f5d0fe" stroke="#334155" d="M2473.5,-156.5C2473.5,-156.5 2246.5,-156.5 2246.5,-156.5 2240.5,-156.5 2234.5,-150.5 2234.5,-144.5 2234.5,-144.5 2234.5,-115.5 2234.5,-115.5 2234.5,-109.5 2240.5,-103.5 2246.5,-103.5 2246.5,-103.5 2473.5,-103.5 2473.5,-103.5 2479.5,-103.5 2485.5,-109.5 2485.5,-115.5 2485.5,-115.5 2485.5,-144.5 2485.5,-144.5 2485.5,-150.5 2479.5,-156.5 2473.5,-156.5"/> -<text text-anchor="middle" x="2360" y="-141.3" font-family="Helvetica,sans-Serif" font-size="14.00">pacstall path</text> -<text text-anchor="middle" x="2360" y="-126.3" font-family="Helvetica,sans-Serif" font-size="14.00">APKBUILD → generated .pacscript</text> -<text text-anchor="middle" x="2360" y="-111.3" font-family="Helvetica,sans-Serif" font-size="14.00">(runtime intermediate)</text> +<path fill="#f5d0fe" stroke="#334155" d="M2478.12,-257.5C2478.12,-257.5 2275.38,-257.5 2275.38,-257.5 2269.38,-257.5 2263.38,-251.5 2263.38,-245.5 2263.38,-245.5 2263.38,-213.5 2263.38,-213.5 2263.38,-207.5 2269.38,-201.5 2275.38,-201.5 2275.38,-201.5 2478.12,-201.5 2478.12,-201.5 2484.12,-201.5 2490.12,-207.5 2490.12,-213.5 2490.12,-213.5 2490.12,-245.5 2490.12,-245.5 2490.12,-251.5 2484.12,-257.5 2478.12,-257.5"/> +<text xml:space="preserve" text-anchor="middle" x="2376.75" y="-240.2" font-family="Helvetica,sans-Serif" font-size="14.00">pacstall path</text> +<text xml:space="preserve" text-anchor="middle" x="2376.75" y="-225.2" font-family="Helvetica,sans-Serif" font-size="14.00">APKBUILD → generated .pacscript</text> +<text xml:space="preserve" text-anchor="middle" x="2376.75" y="-207.2" font-family="Helvetica,sans-Serif" font-size="14.00">(runtime intermediate)</text> </g> <!-- builder->pacstall --> -<g id="edge9" class="edge"> +<g id="edge10" class="edge"> <title>builder->pacstall</title> -<path fill="none" stroke="#475569" stroke-dasharray="5,2" d="M1925.2,-129.18C2009.2,-129.34 2130.95,-129.57 2224.1,-129.75"/> -<polygon fill="#475569" stroke="#475569" points="2224.16,-133.25 2234.16,-129.77 2224.17,-126.25 2224.16,-133.25"/> -<text text-anchor="middle" x="2033.5" y="-133" font-family="Helvetica,sans-Serif" font-size="10.00">only when host install needs pacstall</text> +<path fill="none" stroke="#475569" stroke-dasharray="5,2" d="M1992.68,-177.05C1998.62,-177.88 2004.52,-178.7 2010.25,-179.5 2090.64,-190.67 2181,-203.03 2251.76,-212.67"/> +<polygon fill="#475569" stroke="#475569" points="2251.07,-216.11 2261.45,-213.99 2252.01,-209.17 2251.07,-216.11"/> +<text xml:space="preserve" text-anchor="middle" x="2090.5" y="-203.35" font-family="Helvetica,sans-Serif" font-size="10.00">only when host install needs pacstall</text> </g> <!-- publish --> -<g id="node12" class="node"> +<g id="node13" class="node"> <title>publish</title> -<path fill="#d1fae5" stroke="#334155" d="M2566,-213C2566,-213 2154,-213 2154,-213 2148,-213 2142,-207 2142,-201 2142,-201 2142,-187 2142,-187 2142,-181 2148,-175 2154,-175 2154,-175 2566,-175 2566,-175 2572,-175 2578,-181 2578,-187 2578,-187 2578,-201 2578,-201 2578,-207 2572,-213 2566,-213"/> -<text text-anchor="middle" x="2360" y="-197.8" font-family="Helvetica,sans-Serif" font-size="14.00">atomic publish</text> -<text text-anchor="middle" x="2360" y="-182.8" font-family="Helvetica,sans-Serif" font-size="14.00">$FPKGS_DL_ROOT/<target>/<pkg>/<ver-rrel>/<buildkey>/</text> +<path fill="#d1fae5" stroke="#334155" d="M2552.75,-183.5C2552.75,-183.5 2200.75,-183.5 2200.75,-183.5 2194.75,-183.5 2188.75,-177.5 2188.75,-171.5 2188.75,-171.5 2188.75,-157.5 2188.75,-157.5 2188.75,-151.5 2194.75,-145.5 2200.75,-145.5 2200.75,-145.5 2552.75,-145.5 2552.75,-145.5 2558.75,-145.5 2564.75,-151.5 2564.75,-157.5 2564.75,-157.5 2564.75,-171.5 2564.75,-171.5 2564.75,-177.5 2558.75,-183.5 2552.75,-183.5"/> +<text xml:space="preserve" text-anchor="middle" x="2376.75" y="-166.2" font-family="Helvetica,sans-Serif" font-size="14.00">atomic publish</text> +<text xml:space="preserve" text-anchor="middle" x="2376.75" y="-151.2" font-family="Helvetica,sans-Serif" font-size="14.00">$FPKGS_DL_ROOT/<target>/<pkg>/<ver-rrel>/<buildkey>/</text> </g> <!-- builder->publish --> -<g id="edge10" class="edge"> +<g id="edge11" class="edge"> <title>builder->publish</title> -<path fill="none" stroke="#475569" d="M1925.08,-142.67C1931.14,-143.47 1937.15,-144.25 1943,-145 2020.94,-154.96 2107.19,-165.25 2180.85,-173.8"/> -<polygon fill="#475569" stroke="#475569" points="2180.82,-177.32 2191.16,-175 2181.63,-170.37 2180.82,-177.32"/> -<text text-anchor="middle" x="2033.5" y="-168" font-family="Helvetica,sans-Serif" font-size="10.00">success</text> +<path fill="none" stroke="#475569" d="M1992.63,-164.5C2044.87,-164.5 2113.14,-164.5 2177.56,-164.5"/> +<polygon fill="#475569" stroke="#475569" points="2177.18,-168 2187.18,-164.5 2177.18,-161 2177.18,-168"/> +<text xml:space="preserve" text-anchor="middle" x="2090.5" y="-166.25" font-family="Helvetica,sans-Serif" font-size="10.00">success</text> </g> <!-- fail --> -<g id="node17" class="node"> +<g id="node18" class="node"> <title>fail</title> -<path fill="#fecdd3" stroke="#334155" d="M2417,-85C2417,-85 2303,-85 2303,-85 2297,-85 2291,-79 2291,-73 2291,-73 2291,-59 2291,-59 2291,-53 2297,-47 2303,-47 2303,-47 2417,-47 2417,-47 2423,-47 2429,-53 2429,-59 2429,-59 2429,-73 2429,-73 2429,-79 2423,-85 2417,-85"/> -<text text-anchor="middle" x="2360" y="-69.8" font-family="Helvetica,sans-Serif" font-size="14.00">failed build</text> -<text text-anchor="middle" x="2360" y="-54.8" font-family="Helvetica,sans-Serif" font-size="14.00">build.log retained</text> +<path fill="#fecdd3" stroke="#334155" d="M2424.12,-127.5C2424.12,-127.5 2329.38,-127.5 2329.38,-127.5 2323.38,-127.5 2317.38,-121.5 2317.38,-115.5 2317.38,-115.5 2317.38,-101.5 2317.38,-101.5 2317.38,-95.5 2323.38,-89.5 2329.38,-89.5 2329.38,-89.5 2424.12,-89.5 2424.12,-89.5 2430.12,-89.5 2436.12,-95.5 2436.12,-101.5 2436.12,-101.5 2436.12,-115.5 2436.12,-115.5 2436.12,-121.5 2430.12,-127.5 2424.12,-127.5"/> +<text xml:space="preserve" text-anchor="middle" x="2376.75" y="-110.2" font-family="Helvetica,sans-Serif" font-size="14.00">failed build</text> +<text xml:space="preserve" text-anchor="middle" x="2376.75" y="-95.2" font-family="Helvetica,sans-Serif" font-size="14.00">build.log retained</text> </g> <!-- builder->fail --> -<g id="edge11" class="edge"> +<g id="edge12" class="edge"> <title>builder->fail</title> -<path fill="none" stroke="#475569" d="M1925.09,-117.14C1931.15,-116.41 1937.16,-115.7 1943,-115 2060.67,-100.97 2197.09,-84.95 2280.72,-75.15"/> -<polygon fill="#475569" stroke="#475569" points="2281.37,-78.6 2290.9,-73.96 2280.56,-71.65 2281.37,-78.6"/> -<text text-anchor="middle" x="2033.5" y="-118" font-family="Helvetica,sans-Serif" font-size="10.00">failure</text> +<path fill="none" stroke="#475569" d="M1992.65,-151.56C1998.61,-150.76 2004.51,-149.98 2010.25,-149.25 2112.9,-136.17 2232.08,-123.32 2305.71,-115.65"/> +<polygon fill="#475569" stroke="#475569" points="2306.04,-119.13 2315.62,-114.62 2305.31,-112.17 2306.04,-119.13"/> +<text xml:space="preserve" text-anchor="middle" x="2090.5" y="-151" font-family="Helvetica,sans-Serif" font-size="10.00">failure</text> </g> <!-- dl --> -<g id="node13" class="node"> +<g id="node14" class="node"> <title>dl</title> -<path fill="#a7f3d0" stroke="#334155" d="M2886,-220.5C2886,-220.5 2736,-220.5 2736,-220.5 2730,-220.5 2724,-214.5 2724,-208.5 2724,-208.5 2724,-179.5 2724,-179.5 2724,-173.5 2730,-167.5 2736,-167.5 2736,-167.5 2886,-167.5 2886,-167.5 2892,-167.5 2898,-173.5 2898,-179.5 2898,-179.5 2898,-208.5 2898,-208.5 2898,-214.5 2892,-220.5 2886,-220.5"/> -<text text-anchor="middle" x="2811" y="-205.3" font-family="Helvetica,sans-Serif" font-size="14.00">nply.org/dl now</text> -<text text-anchor="middle" x="2811" y="-190.3" font-family="Helvetica,sans-Serif" font-size="14.00">dl.nply.org later</text> -<text text-anchor="middle" x="2811" y="-175.3" font-family="Helvetica,sans-Serif" font-size="14.00">lighttpd static artifacts</text> +<path fill="#a7f3d0" stroke="#334155" d="M2735.5,-191C2735.5,-191 2613.75,-191 2613.75,-191 2607.75,-191 2601.75,-185 2601.75,-179 2601.75,-179 2601.75,-150 2601.75,-150 2601.75,-144 2607.75,-138 2613.75,-138 2613.75,-138 2735.5,-138 2735.5,-138 2741.5,-138 2747.5,-144 2747.5,-150 2747.5,-150 2747.5,-179 2747.5,-179 2747.5,-185 2741.5,-191 2735.5,-191"/> +<text xml:space="preserve" text-anchor="middle" x="2674.62" y="-173.7" font-family="Helvetica,sans-Serif" font-size="14.00">nply.org/dl now</text> +<text xml:space="preserve" text-anchor="middle" x="2674.62" y="-158.7" font-family="Helvetica,sans-Serif" font-size="14.00">dl.nply.org later</text> +<text xml:space="preserve" text-anchor="middle" x="2674.62" y="-143.7" font-family="Helvetica,sans-Serif" font-size="14.00">lighttpd static artifacts</text> </g> <!-- publish->dl --> -<g id="edge12" class="edge"> -<title>publish->dl</title> -<path fill="none" stroke="#475569" d="M2578.27,-194C2625.83,-194 2673.83,-194 2713.72,-194"/> -<polygon fill="#475569" stroke="#475569" points="2713.94,-197.5 2723.94,-194 2713.94,-190.5 2713.94,-197.5"/> -</g> -<!-- minci --> -<g id="node14" class="node"> -<title>minci</title> -<path fill="#fee2e2" stroke="#334155" d="M2902,-85C2902,-85 2720,-85 2720,-85 2714,-85 2708,-79 2708,-73 2708,-73 2708,-59 2708,-59 2708,-53 2714,-47 2720,-47 2720,-47 2902,-47 2902,-47 2908,-47 2914,-53 2914,-59 2914,-59 2914,-73 2914,-73 2914,-79 2908,-85 2902,-85"/> -<text text-anchor="middle" x="2811" y="-69.8" font-family="Helvetica,sans-Serif" font-size="14.00">minci report</text> -<text text-anchor="middle" x="2811" y="-54.8" font-family="Helvetica,sans-Serif" font-size="14.00">ci.nply.org/cgi-bin/minci.cgi</text> -</g> -<!-- publish->minci --> <g id="edge13" class="edge"> -<title>publish->minci</title> -<path fill="none" stroke="#475569" d="M2535.07,-174.99C2549.69,-172.11 2564.16,-168.8 2578,-165 2645.36,-146.5 2718.85,-112.62 2764.68,-89.7"/> -<polygon fill="#475569" stroke="#475569" points="2766.39,-92.76 2773.74,-85.13 2763.24,-86.51 2766.39,-92.76"/> -<text text-anchor="middle" x="2643" y="-162" font-family="Helvetica,sans-Serif" font-size="10.00">success report</text> +<title>publish->dl</title> +<path fill="none" stroke="#475569" d="M2565.13,-164.5C2573.61,-164.5 2581.9,-164.5 2589.88,-164.5"/> +<polygon fill="#475569" stroke="#475569" points="2589.82,-168 2599.82,-164.5 2589.82,-161 2589.82,-168"/> </g> <!-- web --> -<g id="node15" class="node"> +<g id="node16" class="node"> <title>web</title> -<path fill="#fecaca" stroke="#334155" d="M3048,-85C3048,-85 2963,-85 2963,-85 2957,-85 2951,-79 2951,-73 2951,-73 2951,-59 2951,-59 2951,-53 2957,-47 2963,-47 2963,-47 3048,-47 3048,-47 3054,-47 3060,-53 3060,-59 3060,-59 3060,-73 3060,-73 3060,-79 3054,-85 3048,-85"/> -<text text-anchor="middle" x="3005.5" y="-69.8" font-family="Helvetica,sans-Serif" font-size="14.00">CI dashboard</text> -<text text-anchor="middle" x="3005.5" y="-54.8" font-family="Helvetica,sans-Serif" font-size="14.00">ci.nply.org</text> -</g> -<!-- minci->web --> -<g id="edge16" class="edge"> -<title>minci->web</title> -<path fill="none" stroke="#475569" d="M2914.17,-66C2923.12,-66 2932.01,-66 2940.52,-66"/> -<polygon fill="#475569" stroke="#475569" points="2940.69,-69.5 2950.69,-66 2940.69,-62.5 2940.69,-69.5"/> -</g> -<!-- skipped->minci --> -<g id="edge14" class="edge"> -<title>skipped->minci</title> -<path fill="none" stroke="#475569" d="M1901.54,-15.96C2036.69,-11.3 2331.07,-5.06 2578,-27 2620.47,-30.77 2666.89,-37.96 2706.97,-45.14"/> -<polygon fill="#475569" stroke="#475569" points="2706.55,-48.62 2717.02,-46.96 2707.8,-41.73 2706.55,-48.62"/> -<text text-anchor="middle" x="2360" y="-30" font-family="Helvetica,sans-Serif" font-size="10.00">skip report</text> +<path fill="#fecaca" stroke="#334155" d="M950.75,-39.5C950.75,-39.5 877.75,-39.5 877.75,-39.5 871.75,-39.5 865.75,-33.5 865.75,-27.5 865.75,-27.5 865.75,-13.5 865.75,-13.5 865.75,-7.5 871.75,-1.5 877.75,-1.5 877.75,-1.5 950.75,-1.5 950.75,-1.5 956.75,-1.5 962.75,-7.5 962.75,-13.5 962.75,-13.5 962.75,-27.5 962.75,-27.5 962.75,-33.5 956.75,-39.5 950.75,-39.5"/> +<text xml:space="preserve" text-anchor="middle" x="914.25" y="-22.2" font-family="Helvetica,sans-Serif" font-size="14.00">CI dashboard</text> +<text xml:space="preserve" text-anchor="middle" x="914.25" y="-7.2" font-family="Helvetica,sans-Serif" font-size="14.00">ci.nply.org</text> </g> -<!-- fail->minci --> +<!-- cgi->web --> <g id="edge15" class="edge"> -<title>fail->minci</title> -<path fill="none" stroke="#475569" d="M2429.19,-66C2500.39,-66 2613.22,-66 2697.61,-66"/> -<polygon fill="#475569" stroke="#475569" points="2697.76,-69.5 2707.76,-66 2697.76,-62.5 2697.76,-69.5"/> -<text text-anchor="middle" x="2643" y="-69" font-family="Helvetica,sans-Serif" font-size="10.00">failure report + log</text> +<title>cgi->web</title> +<path fill="none" stroke="#475569" d="M796.9,-20.5C816.33,-20.5 836.31,-20.5 854.11,-20.5"/> +<polygon fill="#475569" stroke="#475569" points="853.95,-24 863.95,-20.5 853.95,-17 853.95,-24"/> </g> </g> </svg>
diff --git a/docs/ci.md b/docs/ci.md @@ -1,68 +1,70 @@ -# foundationpkgs CI glue +# CI -`scripts/fpkgs-ci.sh` is the standalone integration glue for running a -foundationpkgs-style APKBUILD repository from gitolite/minci. +`minci.sh` is the runner for foundationpkgs. The minci CGI at +`https://ci.nply.org/cgi-bin/minci.cgi` receives authenticated job results and +serves the dashboard. -It is intentionally detachable: copy `scripts/fpkgs-ci.sh` plus the existing -`scripts/build.sh` and `scripts/functions.sh` into another APKBUILD repository -and set `FPKGS_ROOT`. +foundationpkgs keeps package logic in this repository. `scripts/fpkgs-ci.sh` +plans APKBUILD work, builds packages, and publishes artifacts. It does not know +about minci authentication; minci owns reporting. -## Interfaces +## Runner configuration -```sh -scripts/fpkgs-ci.sh post-receive -scripts/fpkgs-ci.sh plan [REV] -scripts/fpkgs-ci.sh run [REV] -scripts/fpkgs-ci.sh key APKBUILD TARGET [REV] -``` +On `cdg-1`, gitolite invokes `/usr/local/bin/minci.sh` for pushes to +`refs/heads/main` of `nply/foundationpkgs`. + +The git user has `~git/.minci`: -## Trigger +```text +apikey = ... +apisecret = ... +server = https://ci.nply.org/cgi-bin/minci.cgi +branch = main +autoup = no +repo = /home/git/repositories/nply/foundationpkgs.git +``` -Install a gitolite `post-receive` hook for the repo. The hook reads refs from -stdin and only enqueues builds for `refs/heads/main` by default. +The repository supplies `.config/Jobfile`: ```sh -#!/bin/sh -FPKGS_ROOT=/home/git/repositories/nply/foundationpkgs.git \ -FPKGS_DL_ROOT=/srv/http/dl.nply.org/foundationpkgs \ -FPKGS_DL_BASE_URL=https://nply.org/dl/foundationpkgs \ -FPKGS_WORK_ROOT=/var/tmp/fpkgs-ci \ -/path/to/fpkgs-ci.sh post-receive +project=foundationpkgs +triggers="refs/heads/main: packages" + +packages() { + FPKGS_ROOT=$srcdir \ + FPKGS_WORK_ROOT=$workdir/fpkgs \ + $srcdir/scripts/fpkgs-ci.sh run "$FETCH_HEAD" +} ``` -## Rebuild criteria - -A package/target is skipped only when an artifact manifest already exists for -the computed build key. The build key includes: +`minci.sh` clones/freshens the repository, sources the Jobfile, runs matching +jobs, and reports each job to minci. -- the APKBUILD contents -- local source/patch files referenced by `source` -- `scripts/build.sh`, `scripts/functions.sh`, and APKBUILD-to-pacscript glue -- target triplet -- git revision -- build-affecting environment (`MAKEFLAGS`, `CFLAGS`, `CPPFLAGS`, `LDFLAGS`, - `PKG_CONFIG_PATH`, `CC`, `CHOST`, `CBUILD`) -- visible versions of `cc`, `make`, and `bmake` +## Package helper -Generated `PKGBUILD`/`*.pacscript` files are runtime intermediates and are not -source-of-truth inputs. +Use the package helper directly when developing: -## Publishing +```sh +scripts/fpkgs-ci.sh plan [REV] +scripts/fpkgs-ci.sh run [REV] +scripts/fpkgs-ci.sh key APKBUILD TARGET [REV] +``` -Artifacts are published under: +It publishes artifacts below: -```txt -$FPKGS_DL_ROOT/<target>/<pkgname>/<pkgver>-r<pkgrel>/<buildkey>/ +```text +/srv/http/dl.nply.org/foundationpkgs/<target>/<pkg>/<ver-rrel>/<buildkey>/ ``` -Each directory contains package tarballs, checksums, `build.log`, and a -`manifest` file. `artifact_url` in the manifest is derived from -`$FPKGS_DL_BASE_URL`; it currently defaults to `https://nply.org/dl/foundationpkgs` -so the public path can move to `https://dl.nply.org/foundationpkgs` later without -changing artifact storage. +The public URL is currently: + +```text +https://nply.org/dl/foundationpkgs/ +``` -## POSIX rule +## Notes -The CI glue and APKBUILD recipes should remain POSIX `sh` compatible. Avoid -bash arrays, `[[ ... ]]`, process substitution, and bash-only parameter -expansions. +- APKBUILD is the source of truth. +- Generated `PKGBUILD` and `*.pacscript` files are runtime intermediates. +- Scripts and Jobfiles must stay POSIX `sh`. +- `dl.nply.org` is not used until DNS/certificates are intentionally moved.
diff --git a/docs/minci-handoff.md b/docs/minci-handoff.md @@ -1,157 +0,0 @@ -# minci-handoff - -`minci-handoff` is the provider-neutral runner for minci. It accepts a small shell event from any git provider, sources one APKBUILD-like Jobfile, executes selected jobs, publishes artifacts, and reports job results to minci. - -## Event handoff format - -Thin adapters emit shell variables. They may use lowercase directly because the event is sourced into the Jobfile environment. - -```sh -event=git-push -repo=nply/foundationpkgs -repo_url=ssh://git@nply.org/nply/foundationpkgs.git -repo_path=/home/git/repositories/nply/foundationpkgs.git -ref=refs/heads/main -oldrev=0000000000000000000000000000000000000000 -newrev=... -actor=gitolite -``` - -Uppercase aliases (`REPO_PATH`, `REF`, `NEWREV`, etc.) are also accepted for hook adapters that prefer environment-style names. - -## Server-level Jobfile first - -For now, use a common server Jobfile: - -```txt -/etc/minci-handoff/Jobfile -``` - -Later lookup order should be: - -1. `/etc/minci-handoff/repos.d/<repo>.Jobfile` -2. `refs/heads/integ:.config/Jobfile` -3. default branch `.config/Jobfile` - -Legacy `.config/minci/Jobfile` can be accepted during transition, but new repos should use `.config/Jobfile`. -4. `/etc/minci-handoff/Jobfile` - -## Jobfile format - -A Jobfile is POSIX shell, borrowing APKBUILD conventions: lowercase variables, whitespace lists, function hooks, and `!option` negation. - -```sh -project=foundationpkgs -targets="native" -artifact_path=foundationpkgs - -triggers=" -refs/heads/main: packages -refs/heads/integ: selftest -refs/tags/v*: packages release -" - -default_options="report artifacts failfast" -options_selftest="!artifacts" -options_release="artifacts report !failfast" - -depends_release="packages" -``` - -`triggers` is newline-separated: - -```txt -<ref-pattern>: <job> [<job>...] -``` - -The pattern is a shell `case` pattern matched against `ref`. Jobs run in the order they appear. If `depends_<job>` is set, those jobs must have already completed successfully before `<job>` runs. This gives Ant-like ordered execution by default, with explicit dependencies when the order is not enough. - -## Runner-provided variables - -These intentionally resemble APKBUILD variables and stay general enough for apps, packages, blogs, docs, and static sites: - -```sh -srcdir # checked-out source/content tree -confdir # directory containing the selected Jobfile -workdir # per-job scratch directory -pkgdir # per-job staging directory -destdir # per-job artifact/output directory -artifact_url # public URL for this job's published artifacts -target # target triplet/environment -ref -oldrev -newrev -repo -repo_url -repo_path -actor -``` - -## Function contract - -```sh -prepare() { :; } # optional, once per run -<job>() { ...; } # required for each selected job -<job>_inputs() { ...; } # optional, contributes to job key -<job>_artifacts() { # optional; default is find "$destdir" -type f - find "$destdir" -type f -} -cleanup() { :; } # optional, once per run -``` - -## Options - -Options are APKBUILD-like. `!foo` disables `foo`. - -- `report`: submit this job to minci. -- `!report`: run without minci submission. -- `artifacts`: publish artifacts. -- `!artifacts`: keep logs only. -- `failfast`: stop the run on this job failure. -- `!failfast`: continue after this job failure. -- `allow_failure`: report the failure but treat the dependency as satisfied for later jobs. - -## Foundationpkgs server Jobfile - -```sh -project=foundationpkgs -targets="native" -artifact_path=foundationpkgs -triggers="refs/heads/main: packages" -default_options="report artifacts failfast" - -packages() { - cd "$srcdir" - find Linux Unix noarch any -name APKBUILD -type f | sort | while IFS= read -r apk; do - pkg=$(awk -F= '$1 == "pkgname" { v = $2; gsub(/^"|"$/, "", v); print v; exit }' "$apk") - [ -n "$pkg" ] || pkg=$(dirname "$apk" | sed 's#.*/##') - out="$destdir/$pkg" - mkdir -p "$out" - scripts/build.sh -o "$out" -t "$target" "$apk" - done -} - -packages_inputs() { - find Linux Unix noarch any scripts -type f | sort -} - -packages_artifacts() { - find "$destdir" -type f -} -``` - -## Current implementation - -The bootstrap implementation lives at: - -```txt -scripts/minci-handoff.sh -``` - -It is standalone POSIX shell and accepts: - -```sh -scripts/minci-handoff.sh handle event.env -scripts/minci-handoff.sh run REPO_PATH REF NEWREV [OLDREV] -scripts/minci-handoff.sh post-receive REPO_PATH REPO -```
diff --git a/scripts/fpkgs-ci.sh b/scripts/fpkgs-ci.sh @@ -4,7 +4,6 @@ # treated as runtime intermediates and are ignored when computing build keys. # # Commands: -# fpkgs-ci.sh post-receive # read gitolite post-receive stdin # fpkgs-ci.sh run [REV] # plan, build, publish for REV # fpkgs-ci.sh plan [REV] # print planned work # fpkgs-ci.sh key APKBUILD TARGET [REV] # print build key @@ -15,13 +14,8 @@ # FPKGS_DL_BASE_URL public artifact URL base (default: https://nply.org/dl/foundationpkgs) # FPKGS_WORK_ROOT work/cache root (default: /var/tmp/fpkgs-ci) # FPKGS_TARGETS target triplets (default: native guess_triplet) -# FPKGS_REF ref to build from post-receive (default: refs/heads/main) -# FPKGS_MINCI_URL optional minci CGI URL to report to -# FPKGS_MINCI_KEY optional minci apikey -# FPKGS_MINCI_SECRET optional minci apisecret (reporting is skipped unless set) set -eu -ZERO=0000000000000000000000000000000000000000 SELF_ARG=$0 SELF_DIR=$(cd "$(dirname "$SELF_ARG")" && pwd) SELF=$SELF_DIR/$(basename "$SELF_ARG") @@ -29,7 +23,6 @@ FPKGS_ROOT=${FPKGS_ROOT:-$(pwd)} FPKGS_DL_ROOT=${FPKGS_DL_ROOT:-/srv/http/dl.nply.org/foundationpkgs} FPKGS_DL_BASE_URL=${FPKGS_DL_BASE_URL:-https://nply.org/dl/foundationpkgs} FPKGS_WORK_ROOT=${FPKGS_WORK_ROOT:-/var/tmp/fpkgs-ci} -FPKGS_REF=${FPKGS_REF:-refs/heads/main} if [ -f "$SELF_DIR/functions.sh" ]; then # shellcheck disable=SC1091 @@ -46,7 +39,7 @@ fi usage() { cat >&2 <<EOF -usage: $SELF post-receive | run [REV] | plan [REV] | key APKBUILD TARGET [REV] +usage: $SELF run [REV] | plan [REV] | key APKBUILD TARGET [REV] EOF exit 1 } @@ -229,89 +222,6 @@ publish_output() { mv "$tmp" "$out" } -md5_file() { - openssl dgst -md5 -hex "$1" | sed 's!^[^=]*= !!' -} - -md5_text() { - openssl dgst -md5 -hex | sed 's!^[^=]*= !!' -} - -minci_report() { - apk=$1 - target=$2 - rev=$3 - log=$4 - ok=$5 - [ -n "${FPKGS_MINCI_URL:-}" ] || return 0 - [ -n "${FPKGS_MINCI_KEY:-}" ] || return 0 - [ -n "${FPKGS_MINCI_SECRET:-}" ] || return 0 - command -v curl >/dev/null 2>&1 || return 0 - command -v openssl >/dev/null 2>&1 || return 0 - - project=$(pkg_field "$apk" pkgname) - now=$(date +%s) - start=$now - env=$now - depend=$now - if [ "$ok" = 1 ]; then - build=$now - test=$now - install=$now - distcheck=$now - else - build=0 - test=0 - install=0 - distcheck=0 - fi - loghash=$(md5_file "$log") - report_log_arg="-F report-log=@$log" - unamem=$(uname -m | sed -e 's!^[ ]*!!' -e 's![ ]*$!!') - unamen=$(printf '%s' "$target" | sed -e 's!^[ ]*!!' -e 's![ ]*$!!') - unamer=$(uname -r | sed -e 's!^[ ]*!!' -e 's![ ]*$!!') - unames=$(uname -s | sed -e 's!^[ ]*!!' -e 's![ ]*$!!') - unamev=$(uname -v | sed -e 's!^[ ]*!!' -e 's![ ]*$!!') - - query="project-name=$project" - query="$query&report-build=$build" - query="$query&report-distcheck=$distcheck" - query="$query&report-env=$env" - query="$query&report-fetchhead=$rev" - query="$query&report-depend=$depend" - query="$query&report-install=$install" - query="$query&report-log=$loghash" - query="$query&report-start=$start" - query="$query&report-test=$test" - query="$query&report-unamem=$unamem" - query="$query&report-unamen=$unamen" - query="$query&report-unamer=$unamer" - query="$query&report-unames=$unames" - query="$query&report-unamev=$unamev" - query="$query&user-apisecret=$FPKGS_MINCI_SECRET" - sig=$(printf '%s' "$query" | md5_text) - - # shellcheck disable=SC2086 - curl -sS $report_log_arg \ - -F "project-name=$project" \ - -F "report-start=$start" \ - -F "report-env=$env" \ - -F "report-depend=$depend" \ - -F "report-build=$build" \ - -F "report-test=$test" \ - -F "report-install=$install" \ - -F "report-distcheck=$distcheck" \ - -F "report-unamem=$unamem" \ - -F "report-unamen=$unamen" \ - -F "report-unamer=$unamer" \ - -F "report-unames=$unames" \ - -F "report-unamev=$unamev" \ - -F "report-fetchhead=$rev" \ - -F "user-apikey=$FPKGS_MINCI_KEY" \ - -F "signature=$sig" \ - "$FPKGS_MINCI_URL" >/dev/null || warning "minci report failed for $project" -} - run_one() { root=$1 relapk=$2 @@ -332,11 +242,9 @@ run_one() { msg "build $relapk for $target ($key)" if (cd "$root" && scripts/build.sh -o "$dist" -s "$sysroot" -t "$target" "$relapk") >"$log" 2>&1; then publish_output "$apk" "$target" "$key" "$dist" "$log" "$rev" - minci_report "$apk" "$target" "$rev" "$log" 1 msg "published $relapk for $target" return 0 fi - minci_report "$apk" "$target" "$rev" "$log" 0 warning "failed $relapk for $target; see $log" return 1 } @@ -351,37 +259,15 @@ run() { while read -r action target relapk key; do case "$action" in build) run_one "$root" "$relapk" "$target" "$rev" || status=1 ;; - skip) - msg "skip $relapk for $target: already built ($key)" - minci_report "$root/$relapk" "$target" "$rev" /dev/null 1 - ;; + skip) msg "skip $relapk for $target: already built ($key)" ;; esac done <"$planfile" rm -f "$planfile" return "$status" } -post_receive() { - while read -r old new ref; do - [ "$ref" = "$FPKGS_REF" ] || continue - [ "$new" = "$ZERO" ] && continue - # Avoid running long builds inside gitolite's hook process. - mkdir -p "$FPKGS_WORK_ROOT/queue" - job="$FPKGS_WORK_ROOT/queue/$new" - { - printf 'FPKGS_ROOT=%s\n' "$FPKGS_ROOT" - printf 'FPKGS_DL_ROOT=%s\n' "$FPKGS_DL_ROOT" - printf 'FPKGS_DL_BASE_URL=%s\n' "$FPKGS_DL_BASE_URL" - printf 'FPKGS_WORK_ROOT=%s\n' "$FPKGS_WORK_ROOT" - printf 'REV=%s\n' "$new" - } >"$job" - ( FPKGS_ROOT=$FPKGS_ROOT FPKGS_DL_ROOT=$FPKGS_DL_ROOT FPKGS_DL_BASE_URL=$FPKGS_DL_BASE_URL FPKGS_WORK_ROOT=$FPKGS_WORK_ROOT nohup "$SELF" run "$new" >"$FPKGS_WORK_ROOT/$new.log" 2>&1 & ) - done -} - cmd=${1:-} case "$cmd" in -post-receive) post_receive ;; run) run "${2:-HEAD}" ;; plan) plan "${2:-HEAD}" ;; key) [ $# -ge 3 ] || usage; build_key "$2" "$3" "${4:-HEAD}" ;;
diff --git a/scripts/minci-handoff.sh b/scripts/minci-handoff.sh @@ -1,287 +0,0 @@ -#!/bin/sh -# minci-handoff.sh - provider-neutral handoff runner for minci. -# POSIX sh. Jobfile is APKBUILD-like: lowercase variables and shell functions. -set -eu - -SELF=$0 -SELF_DIR=$(cd "$(dirname "$SELF")" && pwd) -ROOT=$(cd "$SELF_DIR/.." && pwd) - -if [ -f "$SELF_DIR/functions.sh" ]; then - # shellcheck disable=SC1091 - . "$SELF_DIR/functions.sh" -else - msg() { printf '> %s\n' "$*" >&2; } - warning() { printf '! WARNING: %s\n' "$*" >&2; } - die() { printf '! %s\n' "$*" >&2; exit 1; } - guess_triplet() { uname -m | sed 's/x86_64/x86_64-unknown-linux-gnu/'; } -fi - -MINCI_HANDOFF_CONF=${MINCI_HANDOFF_CONF:-/etc/minci-handoff} -MINCI_HANDOFF_WORK=${MINCI_HANDOFF_WORK:-/var/tmp/minci-handoff} -MINCI_HANDOFF_DL_ROOT=${MINCI_HANDOFF_DL_ROOT:-/srv/http/dl.nply.org} -MINCI_HANDOFF_DL_URL=${MINCI_HANDOFF_DL_URL:-https://nply.org/dl} -MINCI_HANDOFF_CONFIG_REF=${MINCI_HANDOFF_CONFIG_REF:-refs/heads/integ} -MINCI_HANDOFF_JOBFILE=${MINCI_HANDOFF_JOBFILE:-} - -for _conf in "$MINCI_HANDOFF_CONF/env" "$MINCI_HANDOFF_CONF/config"; do - if [ -f "$_conf" ]; then - # shellcheck disable=SC1090 - . "$_conf" - fi -done - -usage() { - cat >&2 <<EOF -usage: $SELF handle EVENTFILE | run REPO_PATH REF NEWREV [OLDREV] | post-receive REPO_PATH REPO -EOF - exit 1 -} - -md5_text() { openssl dgst -md5 -hex | sed 's!^[^=]*= !!'; } -md5_file() { openssl dgst -md5 -hex "$1" | sed 's!^[^=]*= !!'; } -sha256_file() { - if command -v sha256sum >/dev/null 2>&1; then sha256sum "$1" | awk '{print $1}'; - else shasum -a 256 "$1" | awk '{print $1}'; fi -} - -field() { - name=$1 - eval "printf '%s\n' \${$name:-}" -} - -native_target() { guess_triplet; } -expand_targets() { - for t in ${targets:-native}; do - case "$t" in native) native_target ;; *) printf '%s\n' "$t" ;; esac - done -} - -selected_jobs() { - [ -n "${triggers:-}" ] || return 0 - printf '%s\n' "$triggers" | while IFS= read -r line; do - case "$line" in ''|'#'*) continue ;; esac - pattern=${line%%:*} - jobs=${line#*:} - pattern=$(printf '%s' "$pattern" | sed -e 's/^[ ]*//' -e 's/[ ]*$//') - case "$ref" in - $pattern) - printf '%s\n' $jobs - [ "${trigger_mode:-first}" = all ] || break - ;; - esac - done -} - -has_opt() { - opt=$1 - shift - present=1 - for o in "$@"; do - case "$o" in - "$opt") present=0 ;; - "!$opt") present=1 ;; - esac - done - return "$present" -} - -job_options() { - job=$1 - eval "extra=\${options_$job:-}" - printf '%s\n' ${default_options:-report artifacts failfast} $extra -} - -job_key() { - job=$1 - { - printf 'repo=%s\nref=%s\noldrev=%s\nnewrev=%s\ntarget=%s\njob=%s\n' \ - "$repo" "$ref" "$oldrev" "$newrev" "$target" "$job" - [ -f "$jobfile" ] && printf 'jobfile=%s\n' "$(sha256_file "$jobfile")" - if command -v "${job}_inputs" >/dev/null 2>&1; then - (cd "$srcdir" && "${job}_inputs") | while IFS= read -r f; do - [ -f "$srcdir/$f" ] && printf 'input %s %s\n' "$f" "$(sha256_file "$srcdir/$f")" - done - fi - for v in MAKEFLAGS CFLAGS CPPFLAGS LDFLAGS PKG_CONFIG_PATH CC; do - eval val=\${$v:-} - printf '%s=%s\n' "$v" "$val" - done - (command -v cc >/dev/null 2>&1 && cc --version 2>/dev/null | sed 1q) || true - (command -v make >/dev/null 2>&1 && make --version 2>/dev/null | sed 1q) || true - (command -v bmake >/dev/null 2>&1 && bmake -V MAKE_VERSION 2>/dev/null) || true - } | if command -v sha256sum >/dev/null 2>&1; then sha256sum | awk '{print $1}'; else shasum -a 256 | awk '{print $1}'; fi -} - -checkout() { - mkdir -p "$MINCI_HANDOFF_WORK/checkouts" - srcdir=$MINCI_HANDOFF_WORK/checkouts/$newrev/src - if [ ! -d "$srcdir/.git" ]; then - rm -rf "$MINCI_HANDOFF_WORK/checkouts/$newrev" - mkdir -p "$MINCI_HANDOFF_WORK/checkouts/$newrev" - git clone -q "$repo_path" "$srcdir" - (cd "$srcdir" && git checkout -q "$newrev") - fi -} - -find_jobfile() { - if [ -n "$MINCI_HANDOFF_JOBFILE" ]; then - jobfile=$MINCI_HANDOFF_JOBFILE - elif [ -f "$MINCI_HANDOFF_CONF/repos.d/$repo.Jobfile" ]; then - jobfile=$MINCI_HANDOFF_CONF/repos.d/$repo.Jobfile - elif [ -f "$MINCI_HANDOFF_CONF/Jobfile" ]; then - jobfile=$MINCI_HANDOFF_CONF/Jobfile - else - die "no Jobfile for $repo" - fi - confdir=$(cd "$(dirname "$jobfile")" && pwd) -} - -report_minci() { - job=$1 - log=$2 - ok=$3 - [ -n "${minci_url:-}" ] || return 0 - [ -n "${minci_key:-}" ] || return 0 - [ -n "${minci_secret:-}" ] || return 0 - now=$(date +%s) - start=$now; env=$now; depend=$now - if [ "$ok" = 1 ]; then build=$now; test=$now; install=$now; distcheck=$now; else build=0; test=0; install=0; distcheck=0; fi - loghash=$(md5_file "$log") - unamem=$(uname -m); unamen=$target; unamer=$(uname -r); unames=$(uname -s); unamev=$(uname -v) - p=${project:-$repo} - case "$p" in *:*) project_name=$p/$job ;; *) project_name=$p:$job ;; esac - query="project-name=$project_name&report-build=$build&report-distcheck=$distcheck&report-env=$env&report-fetchhead=$newrev&report-depend=$depend&report-install=$install&report-log=$loghash&report-start=$start&report-test=$test&report-unamem=$unamem&report-unamen=$unamen&report-unamer=$unamer&report-unames=$unames&report-unamev=$unamev&user-apisecret=$minci_secret" - sig=$(printf '%s' "$query" | md5_text) - curl -sS -F "report-log=@$log" -F "project-name=$project_name" \ - -F "report-start=$start" -F "report-env=$env" -F "report-depend=$depend" \ - -F "report-build=$build" -F "report-test=$test" -F "report-install=$install" \ - -F "report-distcheck=$distcheck" -F "report-unamem=$unamem" \ - -F "report-unamen=$unamen" -F "report-unamer=$unamer" -F "report-unames=$unames" \ - -F "report-unamev=$unamev" -F "report-fetchhead=$newrev" \ - -F "user-apikey=$minci_key" -F "signature=$sig" "$minci_url" >/dev/null || \ - warning "minci report failed: $project_name" -} - -publish_job() { - job=$1 - key=$2 - out=$MINCI_HANDOFF_DL_ROOT/${artifact_path:-$repo}/$target/$newrev/$job/$key - tmp=$out.tmp.$$ - rm -rf "$tmp" - mkdir -p "$tmp" - if command -v "${job}_artifacts" >/dev/null 2>&1; then - artifacts=$workdir/artifacts.list - "${job}_artifacts" >"$artifacts" - else - find "$destdir" -type f >"$workdir/artifacts.list" - artifacts=$workdir/artifacts.list - fi - while IFS= read -r f; do - [ -f "$f" ] || continue - cp "$f" "$tmp/" - done <"$artifacts" - cp "$log" "$tmp/build.log" - { - printf 'project=%s\njob=%s\nrepo=%s\nref=%s\nnewrev=%s\ntarget=%s\nkey=%s\n' \ - "${project:-$repo}" "$job" "$repo" "$ref" "$newrev" "$target" "$key" - printf 'artifact_url=%s/%s/%s/%s/%s/%s/\n' "$MINCI_HANDOFF_DL_URL" "${artifact_path:-$repo}" "$target" "$newrev" "$job" "$key" - } >"$tmp/manifest" - mkdir -p "$(dirname "$out")" - rm -rf "$out" - mv "$tmp" "$out" -} - -run_job() { - job=$1 - key=$(job_key "$job") - workdir=$MINCI_HANDOFF_WORK/build/$key - pkgdir=$workdir/pkg - destdir=$workdir/artifacts - log=$workdir/build.log - artifact_url=$MINCI_HANDOFF_DL_URL/${artifact_path:-$repo}/$target/$newrev/$job/$key/ - export srcdir confdir workdir pkgdir destdir artifact_url target ref oldrev newrev repo repo_url repo_path actor - rm -rf "$workdir" - mkdir -p "$pkgdir" "$destdir" - opts=$(job_options "$job") - msg "job $job target $target" - if "$job" >"$log" 2>&1; then - if has_opt artifacts $opts; then publish_job "$job" "$key"; fi - if has_opt report $opts; then report_minci "$job" "$log" 1; fi - return 0 - fi - if has_opt report $opts; then report_minci "$job" "$log" 0; fi - warning "job failed: $job (see $log)" - has_opt allow_failure $opts && return 0 - return 1 -} - -run_all() { - checkout - find_jobfile - # shellcheck disable=SC1090 - . "$jobfile" - jobs=$(selected_jobs) - [ -n "$jobs" ] || { msg "no jobs selected for $ref"; return 0; } - if command -v prepare >/dev/null 2>&1; then prepare; fi - for target in $(expand_targets); do - done_jobs= - for job in $jobs; do - eval "deps=\${depends_$job:-}" - missing= - for dep in $deps; do - list_has "$dep" $done_jobs || missing="$missing $dep" - done - if [ -n "$missing" ]; then - log=$MINCI_HANDOFF_WORK/skipped-$job-$$.log - mkdir -p "$MINCI_HANDOFF_WORK" - printf 'skipped: missing job dependencies:%s\n' "$missing" >"$log" - report_minci "$job" "$log" 0 - warning "skipped $job: missing dependencies:$missing" - continue - fi - if run_job "$job"; then - done_jobs="$done_jobs $job" - else - opts=$(job_options "$job") - has_opt failfast $opts && return 1 - fi - done - done - if command -v cleanup >/dev/null 2>&1; then cleanup; fi -} - -handle() { - # shellcheck disable=SC1090 - . "$1" - repo=${repo:-${REPO:-}} - repo_path=${repo_path:-${REPO_PATH:-}} - repo_url=${repo_url:-${REPO_URL:-$repo_path}} - ref=${ref:-${REF:-}} - oldrev=${oldrev:-${OLDREV:-}} - newrev=${newrev:-${NEWREV:-}} - actor=${actor:-${ACTOR:-}} - [ -n "$repo" ] || repo=$(basename "$repo_path" .git) - [ -n "$repo_path" ] || die "repo_path required" - [ -n "$ref" ] || die "ref required" - [ -n "$newrev" ] || die "newrev required" - oldrev=${oldrev:-0000000000000000000000000000000000000000} - run_all -} - -cmd=${1:-} -case "$cmd" in -handle) [ $# -eq 2 ] || usage; handle "$2" ;; -run) - [ $# -ge 4 ] || usage - repo_path=$2; ref=$3; newrev=$4; oldrev=${5:-0000000000000000000000000000000000000000} - repo=$(basename "$repo_path" .git); repo_url=$repo_path; actor=manual - run_all - ;; -post-receive) - [ $# -eq 3 ] || usage - repo_path=$2; repo=$3; repo_url=$repo_path; actor=gitolite - while read -r oldrev newrev ref; do run_all; done - ;; -*) usage ;; -esac
: nply/foundationpkgs