Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b926b303c5 | |||
| d14ccdf939 | |||
| 259f439101 | |||
| 1f454fa656 | |||
| 18c0e27da4 | |||
| d34b41b899 | |||
| 9fe86c4114 | |||
| 3b5ff4cf41 | |||
| 7b51f818d7 | |||
| 5a16695338 |
@@ -1,12 +1,16 @@
|
||||
FROM archlinux/archlinux:base-devel
|
||||
|
||||
COPY scripts/entrypoint.sh /scripts/entrypoint.sh
|
||||
COPY scripts/pacman.conf.arch/* /scripts/pacman.conf/
|
||||
COPY scripts/pacman.conf.arch/pacman.conf.pl /scripts/pacman.conf.pl
|
||||
|
||||
ARG MIRROR=https://mirror.sanin.dev/arch-linux/\$repo/os/\$arch
|
||||
ARG BUILDMIRROR=https://mirror.sanin.dev/arch-linux/\$repo/os/\$arch
|
||||
|
||||
RUN sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist && \
|
||||
RUN cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak && \
|
||||
sed -i "1iServer = $BUILDMIRROR" /etc/pacman.d/mirrorlist && \
|
||||
pacman -Syu --noconfirm git clang sudo devtools vim bash-completion && \
|
||||
pacman -Scc --noconfirm && \
|
||||
rm -rf /var/lib/pacman/sync /var/cache/pacman/pkg && \
|
||||
mv /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist && \
|
||||
git config --global init.defaultBranch "master" && \
|
||||
chmod +x /scripts/* && \
|
||||
useradd -m user && \
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
FROM artixlinux/artixlinux:base-devel
|
||||
|
||||
COPY scripts/entrypoint.sh /scripts/entrypoint.sh
|
||||
COPY scripts/pacman.conf.artix/* /scripts/pacman.conf/
|
||||
COPY scripts/pacman.conf.artix/pacman.conf.pl /scripts/pacman.conf.pl
|
||||
|
||||
ARG MIRROR=https://mirror.sanin.dev/artix-linux/\$repo/os/\$arch
|
||||
ARG BUILDMIRROR=https://mirror.sanin.dev/artix-linux/\$repo/os/\$arch
|
||||
|
||||
RUN sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist && \
|
||||
RUN cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak && \
|
||||
sed -i "1iServer = $BUILDMIRROR" /etc/pacman.d/mirrorlist && \
|
||||
pacman -Syu --noconfirm git clang sudo vim glibc openssh bash-completion && \
|
||||
pacman -Scc --noconfirm && \
|
||||
rm -rf /var/lib/pacman/sync /var/cache/pacman/pkg && \
|
||||
mv /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist && \
|
||||
git config --global init.defaultBranch "master" && \
|
||||
chmod +x /scripts/* && \
|
||||
useradd -m user && \
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -n "$DEP" ] && [ "$DEP" != "stable" ]
|
||||
/scripts/pacman.conf.pl | sudo tee "/etc/pacman.conf" > /dev/null
|
||||
|
||||
if [ -n "$MIRROR" ]
|
||||
then
|
||||
sudo cp "/scripts/pacman.conf/pacman.$DEP.conf" "/etc/pacman.conf" && \
|
||||
sudo pacman -Syu --noconfirm --noprogressbar
|
||||
sudo sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$REPO" ]
|
||||
then
|
||||
/bin/bash
|
||||
exit $?;
|
||||
else
|
||||
sudo pacman -Syu --noconfirm --noprogressbar
|
||||
fi
|
||||
|
||||
checkoutCommit() {
|
||||
@@ -27,6 +31,21 @@ applyPatch() {
|
||||
fi
|
||||
}
|
||||
|
||||
postEntrypoint() {
|
||||
if [ -n "$POST" ] && [ -x "./post-entrypoint.sh" ] ; then
|
||||
echo "EXECUTING POSTENTRY"
|
||||
./post-entrypoint.sh
|
||||
fi
|
||||
}
|
||||
|
||||
doBuild() {
|
||||
if [ -n "$POST" ] && [ -x "./post-entrypoint.sh" ] ; then
|
||||
makepkg -smf --noconfirm --noprogressbar --skippgpcheck
|
||||
else
|
||||
makepkg -smf --noconfirm --noprogressbar --skippgpcheck --noarchive
|
||||
fi
|
||||
}
|
||||
|
||||
changeDir() {
|
||||
if [ -n "$CD" ]
|
||||
then
|
||||
@@ -34,12 +53,15 @@ changeDir() {
|
||||
fi
|
||||
}
|
||||
|
||||
if [ ! -d "/home/user/pkg" ]; then
|
||||
git clone "$REPO" /home/user/pkg || exit $?
|
||||
DIR="${WORKSPACE:-/home/user/pkg}"
|
||||
|
||||
if [ ! -d "$DIR" ]; then
|
||||
git clone "$REPO" "$DIR" || exit $?
|
||||
fi
|
||||
cd /home/user/pkg && \
|
||||
cd "$DIR" && \
|
||||
checkoutCommit && \
|
||||
applyPatch && \
|
||||
sudo pacman -Syu --noconfirm --noprogressbar &&\
|
||||
makepkg -smf --noconfirm --noprogressbar --skippgpcheck --noarchive
|
||||
doBuild && \
|
||||
postEntrypoint
|
||||
exit $?;
|
||||
|
||||
50
docker/scripts/pacman.conf.arch/pacman.staging.conf → docker/scripts/pacman.conf.arch/pacman.conf.pl
Normal file → Executable file
50
docker/scripts/pacman.conf.arch/pacman.staging.conf → docker/scripts/pacman.conf.arch/pacman.conf.pl
Normal file → Executable file
@@ -1,3 +1,12 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $dep = $ENV{DEP} // 'stable';
|
||||
my $tier = $ENV{TIER} // '1';
|
||||
|
||||
#region header
|
||||
print <<'EOHEADER';
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
@@ -12,24 +21,61 @@ DownloadUser = alpm
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
EOHEADER
|
||||
#endregion
|
||||
|
||||
#region core
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOCORESTAGING';
|
||||
[core-staging]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOCORESTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOCORETESTING';
|
||||
[core-testing]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOCORETESTING
|
||||
}
|
||||
|
||||
print <<'EOCORE';
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOCORE
|
||||
#endregion
|
||||
|
||||
#region extra
|
||||
if ($tier ne '0') {
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOEXTRASTAGING';
|
||||
[extra-staging]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOEXTRASTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOEXTRATESTING';
|
||||
[extra-testing]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOEXTRATESTING
|
||||
}
|
||||
|
||||
print <<'EOEXTRA';
|
||||
[extra]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOEXTRA
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region options
|
||||
print <<'EOOPTIONS';
|
||||
[options]
|
||||
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
|
||||
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
|
||||
@@ -42,4 +88,6 @@ NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/
|
||||
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
|
||||
NoExtract = usr/share/man/* usr/share/info/*
|
||||
NoExtract = usr/share/vim/vim*/lang/*
|
||||
NoExtract = etc/pacman.conf etc/pacman.d/mirrorlist
|
||||
NoExtract = etc/pacman.conf etc/pacman.d/mirrorlist
|
||||
EOOPTIONS
|
||||
#endregion
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
|
||||
[options]
|
||||
HoldPkg = pacman glibc
|
||||
Architecture = auto
|
||||
NoProgressBar
|
||||
VerbosePkgLists
|
||||
ParallelDownloads = 5
|
||||
DownloadUser = alpm
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
|
||||
[core-testing]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[extra-testing]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[extra]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[options]
|
||||
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
|
||||
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
|
||||
NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/*
|
||||
NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.*
|
||||
NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso*
|
||||
NoExtract = !usr/share/*locales/trans*
|
||||
NoExtract = !usr/share/X11/locale/C/*
|
||||
NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/*
|
||||
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
|
||||
NoExtract = usr/share/man/* usr/share/info/*
|
||||
NoExtract = usr/share/vim/vim*/lang/*
|
||||
NoExtract = etc/pacman.conf etc/pacman.d/mirrorlist
|
||||
67
docker/scripts/pacman.conf.artix/pacman.staging.conf → docker/scripts/pacman.conf.artix/pacman.conf.pl
Normal file → Executable file
67
docker/scripts/pacman.conf.artix/pacman.staging.conf → docker/scripts/pacman.conf.artix/pacman.conf.pl
Normal file → Executable file
@@ -1,3 +1,12 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $dep = $ENV{DEP} // 'stable';
|
||||
my $tier = $ENV{TIER} // '1';
|
||||
|
||||
#region header
|
||||
print <<'EOHEADER';
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
@@ -12,33 +21,87 @@ DownloadUser = alpm
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
EOHEADER
|
||||
#endregion
|
||||
|
||||
#region system
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOSYSTEMSTAGING';
|
||||
[system-goblins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOSYSTEMSTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOSYSTEMTESTING';
|
||||
[system-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOSYSTEMTESTING
|
||||
}
|
||||
|
||||
print <<'EOSYSTEM';
|
||||
[system]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOSYSTEM
|
||||
#endregion
|
||||
|
||||
#region world
|
||||
if ($tier ne '0') {
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOWORLDSTAGING';
|
||||
[world-goblins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOWORLDSTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOWORLDTESTING';
|
||||
[world-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOWORLDTESTING
|
||||
}
|
||||
|
||||
print <<'EOWORLD';
|
||||
[world]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOWORLD
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region galaxy
|
||||
if ($tier eq '2') {
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOGALAXYSTAGING';
|
||||
[galaxy-goblins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOGALAXYSTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOGALAXYTESTING';
|
||||
[galaxy-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOGALAXYTESTING
|
||||
}
|
||||
|
||||
print <<'EOGALAXY';
|
||||
[galaxy]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOGALAXY
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region options
|
||||
print <<'EOOPTIONS';
|
||||
[options]
|
||||
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
|
||||
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
|
||||
@@ -50,4 +113,6 @@ NoExtract = !usr/share/X11/locale/C/*
|
||||
NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/*
|
||||
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
|
||||
NoExtract = usr/share/man/* usr/share/info/*
|
||||
NoExtract = usr/share/vim/vim*/lang/*
|
||||
NoExtract = usr/share/vim/vim*/lang/*
|
||||
EOOPTIONS
|
||||
#endregion
|
||||
@@ -1,44 +0,0 @@
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
|
||||
[options]
|
||||
HoldPkg = pacman glibc
|
||||
Architecture = auto
|
||||
NoProgressBar
|
||||
VerbosePkgLists
|
||||
ParallelDownloads = 5
|
||||
DownloadUser = alpm
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
[system-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[system]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[world-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[world]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[galaxy-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[galaxy]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[options]
|
||||
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
|
||||
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
|
||||
NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/*
|
||||
NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.*
|
||||
NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso*
|
||||
NoExtract = !usr/share/*locales/trans*
|
||||
NoExtract = !usr/share/X11/locale/C/*
|
||||
NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/*
|
||||
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
|
||||
NoExtract = usr/share/man/* usr/share/info/*
|
||||
NoExtract = usr/share/vim/vim*/lang/*
|
||||
50
package-lock.json
generated
50
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "archery",
|
||||
"version": "0.2.3",
|
||||
"version": "0.2.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "archery",
|
||||
"version": "0.2.3",
|
||||
"version": "0.2.4",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"body-parser": "^2.2.0",
|
||||
@@ -26,13 +26,13 @@
|
||||
"@types/express": "^5.0.3",
|
||||
"@types/express-session": "^1.18.2",
|
||||
"@types/express-ws": "3.0.5",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/passport": "1.0.17",
|
||||
"@types/passport-openidconnect": "0.1.3",
|
||||
"forking-build-shit": "1.0.4"
|
||||
"forking-build-shit": "1.0.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "5.7.3"
|
||||
"typescript": "5.9.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@parcel/watcher": {
|
||||
@@ -443,12 +443,12 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz",
|
||||
"integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==",
|
||||
"version": "24.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz",
|
||||
"integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.12.0"
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/oauth": {
|
||||
@@ -1098,14 +1098,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/forking-build-shit": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/forking-build-shit/-/forking-build-shit-1.0.4.tgz",
|
||||
"integrity": "sha512-pknWCgvJWSkP30sMllWzFxJhjFtXCRuILgYT1N7pJLAyI/SXQ0RXyhTcg+hjCnKaH4aVpxWUFUF2afwTDRO6RA==",
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/forking-build-shit/-/forking-build-shit-1.0.5.tgz",
|
||||
"integrity": "sha512-b9HVQF1f2qXkgB+yTJe3U2kLfggvbUZjU1aqljI0E8O+sxo+cQH/HsyMGdHNPaUoMgSe/qfOsL6CPumu0jrrdg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"csso": "5.0.5",
|
||||
"sass": "1.90.0",
|
||||
"sass": "1.93.2",
|
||||
"uglify-js": "3.19.3"
|
||||
},
|
||||
"bin": {
|
||||
@@ -1251,9 +1251,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/immutable": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.3.tgz",
|
||||
"integrity": "sha512-+chQdDfvscSF1SJqv2gn4SRO2ZyS3xL3r7IW/wWEEzrzLisnOlKiQu5ytC/BVNcS15C39WT2Hg/bjKjDMcu+zg==",
|
||||
"version": "5.1.4",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.4.tgz",
|
||||
"integrity": "sha512-p6u1bG3YSnINT5RQmx/yRZBpenIl30kVxkTLDyHLIMk0gict704Q9n+thfDI7lTRm9vXdDYutVzXhzcThxTnXA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -1898,9 +1898,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sass": {
|
||||
"version": "1.90.0",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.90.0.tgz",
|
||||
"integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==",
|
||||
"version": "1.93.2",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.93.2.tgz",
|
||||
"integrity": "sha512-t+YPtOQHpGW1QWsh1CHQ5cPIr9lbbGZLZnbihP/D/qZj/yuV68m8qarcV17nvkOX81BCrvzAlq2klCQFZghyTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -2206,9 +2206,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.7.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
|
||||
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
|
||||
"version": "5.9.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
@@ -2251,9 +2251,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.12.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz",
|
||||
"integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==",
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "archery",
|
||||
"version": "0.2.3",
|
||||
"version": "0.2.4",
|
||||
"description": "Build Arch packages through a web interface",
|
||||
"keywords": [
|
||||
"docker",
|
||||
@@ -37,13 +37,13 @@
|
||||
"@types/express": "^5.0.3",
|
||||
"@types/express-session": "^1.18.2",
|
||||
"@types/express-ws": "3.0.5",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/passport": "1.0.17",
|
||||
"@types/passport-openidconnect": "0.1.3",
|
||||
"forking-build-shit": "1.0.4"
|
||||
"forking-build-shit": "1.0.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "5.7.3"
|
||||
"typescript": "5.9.3"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npx build-shit",
|
||||
|
||||
@@ -15,6 +15,11 @@ interface BuildEvent {
|
||||
message: any;
|
||||
}
|
||||
|
||||
interface ControllerConfig {
|
||||
"arch-mirror"?: string;
|
||||
"artix-mirror"?: string;
|
||||
}
|
||||
|
||||
function getContainerName(id: number) {
|
||||
return `archery-build-${id}`;
|
||||
}
|
||||
@@ -24,9 +29,11 @@ class BuildController extends EventEmitter {
|
||||
private running: boolean = false;
|
||||
private interval: NodeJS.Timeout;
|
||||
private cancelled: boolean = false;
|
||||
private config: ControllerConfig;
|
||||
|
||||
constructor(config = {}) {
|
||||
constructor(config: ControllerConfig = {}) {
|
||||
super();
|
||||
this.config = config;
|
||||
// this.interval = setInterval(this.triggerBuild, 60000);
|
||||
}
|
||||
|
||||
@@ -84,7 +91,7 @@ class BuildController extends EventEmitter {
|
||||
}
|
||||
|
||||
private build = async (build: Build) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
return new Promise<void>((resolve, _) => {
|
||||
const docker = spawn.spawn('docker', this.createBuildParams(build));
|
||||
docker.on('spawn', () => {
|
||||
const remainder = {
|
||||
@@ -129,6 +136,7 @@ class BuildController extends EventEmitter {
|
||||
}
|
||||
|
||||
private createBuildParams = (build: Build) => {
|
||||
const customMirror = this.config?.[`${build.distro}-mirror`];
|
||||
const params = ['run', '--rm', '-e', `REPO=${build.repo}`];
|
||||
if (build.dependencies) {
|
||||
params.push('-e', `DEP=${build.dependencies}`);
|
||||
@@ -139,6 +147,9 @@ class BuildController extends EventEmitter {
|
||||
if (build.patch) {
|
||||
params.push('-e', `PATCH=${build.patch}`);
|
||||
}
|
||||
if (customMirror && typeof customMirror === 'string' && customMirror.length > 0) {
|
||||
params.push('-e', `MIRROR=${customMirror}`);
|
||||
}
|
||||
params.push('--name', getContainerName(build.id));
|
||||
params.push(docker_images[build.distro]);
|
||||
return params;
|
||||
@@ -188,4 +199,4 @@ class BuildController extends EventEmitter {
|
||||
|
||||
export default BuildController;
|
||||
export { BuildController };
|
||||
export type { BuildEvent, LogType };
|
||||
export type { BuildEvent, LogType, ControllerConfig };
|
||||
@@ -5,16 +5,18 @@ import { DB } from './DB.ts';
|
||||
import { BuildController } from './BuildController.ts';
|
||||
import type { WebConfig } from './Web.ts';
|
||||
import type { DBConfig } from './DB.ts';
|
||||
import type { ControllerConfig } from './BuildController.ts';
|
||||
|
||||
interface compositeConfig {
|
||||
web?: WebConfig,
|
||||
db?: DBConfig
|
||||
db?: DBConfig,
|
||||
controller?: ControllerConfig,
|
||||
}
|
||||
|
||||
const config: compositeConfig = JSON.parse(await fs.promises.readFile(process.env.config || process.env.CONFIG || path.join(process.cwd(), 'config', 'config.json'), 'utf-8'));
|
||||
|
||||
const web = new Web(config.web);
|
||||
const buildController = new BuildController();
|
||||
const buildController = new BuildController(config.controller);
|
||||
await new Promise((resolve) => setTimeout(resolve, 1500));
|
||||
const db = new DB(config.db);
|
||||
web.setDB(db);
|
||||
|
||||
Reference in New Issue
Block a user