Compare commits

..

No commits in common. "5a28cc9b522ad777949440aad5e61739128825cc" and "d53fd9018510cf96e70f8d4fb84857b9c32a4745" have entirely different histories.

7 changed files with 49 additions and 93 deletions

1
.gitignore vendored
View File

@ -3,7 +3,6 @@ src/ascii-invaders**
src/HelloWorld** src/HelloWorld**
pkg/ pkg/
testing.log testing.log
wiki/
# Packaging outputs # Packaging outputs
*.pkg.tar.zst *.pkg.tar.zst

12
LICENSE
View File

@ -16,16 +16,12 @@
ANINIX ADDENDUM ANINIX ADDENDUM
Trademark 2017 (https://aninix.net/) Trademark Pending 2017 (https://aninix.net/irc/)
The "AniNIX" name and |> logo are trademarked as of 2017/11/21. The "AniNIX" name and |> logo is trademark-pending as of 2017. All
AniNIX materials may be reproduced and re-used (though you must AniNIX materials can be reproduced and re-used, though you must
contact the admins of the network to get written permission to use contact the admins of the network to get written permission to use
the AniNIX name or logo) so long as such reproduction or re-use the AniNIX name.
does not inhibit the original AniNIX use of the same.
Attribution is appreciated for other materials but not legally Attribution is appreciated for other materials but not legally
required or necessary. required or necessary.
"AniNIX" trademark serial: 87177883
|> Logo trademark serial: 87177887

View File

@ -21,7 +21,7 @@ install: ${list} MaatIcon.png
for i in ${systemdList}; do install -m 0644 -o root $$i ${pkgdir}/usr/lib/systemd/system; done for i in ${systemdList}; do install -m 0644 -o root $$i ${pkgdir}/usr/lib/systemd/system; done
clean: clean:
git clean -fdX cat .gitignore | sudo xargs rm -Rf
uninstall: uninstall:
for i in ${list}; do rm -Rf ${installDir}/$$i; done for i in ${list}; do rm -Rf ${installDir}/$$i; done
@ -29,21 +29,7 @@ uninstall:
rmdir -p ${pkgdir}${serverRoot}/src rmdir -p ${pkgdir}${serverRoot}/src
rmdir -p ${pkgdir}${serverRoot}/pkg rmdir -p ${pkgdir}${serverRoot}/pkg
test: test: clean
./maat -h | grep -c Usage 1>/dev/null
checkperm:
chown -R ${owner}: ${pkgdir}${serverRoot}/src
chown -R ${owner}: ${pkgdir}${serverRoot}/pkg
for i in ${list}; do chown -R ${owner}: "${installDir}/$$i"; sudo chmod ${perms} "${installDir}/$$i"; done
diff:
for i in ${list}; do if [ -f ${installDir}/$$i ]; then diff "$$i" "${installDir}/$$i"; fi done
reverse:
for i in ${list}; do if [ -f ${installDir}/$$i ]; then cp "${installDir}/$$i" "$$i"; fi done
extendedtest: clean
sudo ./maat -u $$USER -T sudo ./maat -u $$USER -T
test -d src test -d src
test -d src/ascii-invaders test -d src/ascii-invaders
@ -62,3 +48,14 @@ extendedtest: clean
make clean make clean
@echo @echo
@echo Tests passed successfully. @echo Tests passed successfully.
diff:
for i in ${list}; do if [ -f ${installDir}/$$i ]; then diff "$$i" "${installDir}/$$i"; fi done
reverse:
for i in ${list}; do if [ -f ${installDir}/$$i ]; then cp "${installDir}/$$i" "$$i"; fi done
checkperm:
chown -R ${owner}: ${pkgdir}${serverRoot}/src
chown -R ${owner}: ${pkgdir}${serverRoot}/pkg
for i in ${list}; do chown -R ${owner}: "${installDir}/$$i"; sudo chmod ${perms} "${installDir}/$$i"; done

View File

@ -9,14 +9,14 @@ pkgrel() {
echo $(( `git log "$(git describe --tag --abbrev=0)"..HEAD | grep -c commit` + 1 )) echo $(( `git log "$(git describe --tag --abbrev=0)"..HEAD | grep -c commit` + 1 ))
} }
epoch="$(git log | grep -c commit)" epoch="$(git log | grep -c commit)"
pkgdesc="$(head -n 1 README.md)" pkgdesc="$(head -n 1 README)"
arch=("x86_64") arch=("x86_64")
url="$(git config remote.origin.url | sed 's/.git$//')" url="https://aninix.net/foundation/${pkgname}"
license=('custom') license=('custom')
groups=() groups=()
provides=("${pkgname}") provides=("${pkgname}")
conflicts=() conflicts=()
replaces=("${pkgname,,}" "aninix-${pkgname,,}") replaces=("${pkgname,,}", "aninix-${pkgname,,}")
backup=(usr/local/etc/Maat/aur.list) backup=(usr/local/etc/Maat/aur.list)
options=() options=()
install=installscript install=installscript
@ -28,7 +28,7 @@ validpgpkeys=()
prepare() { prepare() {
git pull git pull
make -C .. test make -C .. test && make -C .. clean
} }
build() { build() {

View File

@ -13,7 +13,3 @@ Maat also consumes a GPG key. The admin will need to set up this key and publish
# Available Clients # Available Clients
As Maat is a pipeline for ArchLinux systems, the primary client is [Pacman](https://wiki.archlinux.org/title/Pacman). You can see how to subscribe your host to Maat in [this configuration snippet](https://aninix.net/AniNIX/Ubiqtorate/src/branch/main/roles/ShadowArch/files/pacman.conf#L103). As Maat is a pipeline for ArchLinux systems, the primary client is [Pacman](https://wiki.archlinux.org/title/Pacman). You can see how to subscribe your host to Maat in [this configuration snippet](https://aninix.net/AniNIX/Ubiqtorate/src/branch/main/roles/ShadowArch/files/pacman.conf#L103).
# Equivalents or Competition
General equivalents are Jenkins or GitLab CI/CD Runners. We chose to write our own because these are resource-intensive and often insecure. AniNIX/Maat enacts exactly the steps as detailed by Arch and only offers a noninteractive dashboard -- users are only able to see the artifacts and all changes must be done in upstream.

37
maat
View File

@ -83,7 +83,7 @@ function BuildRepo() {
git clone "$repo" git clone "$repo"
fi fi
cd "$repodir" cd "$repodir"
git clean -fdX git reset --hard origin &>/dev/null
output="$(git pull 2>&1)" output="$(git pull 2>&1)"
if [ -n "$incremental" ] && [ $( echo "$output" | grep -c 'Already up to date.' ) -eq 1 ]; then if [ -n "$incremental" ] && [ $( echo "$output" | grep -c 'Already up to date.' ) -eq 1 ]; then
return; return;
@ -138,20 +138,6 @@ function UpdateLocalRepo() {
set +x set +x
} }
### Clean source tracking
function CleanSrcTracking() {
searchbase="${homedir}/src"
for path in `find "$searchbase" -maxdepth 1 -mindepth 1 -type d`; do
cd "$path"
giturl="$(git config remote.origin.url)"
if ! grep "$giturl" "$aurconf"; then
cd "$searchbase"
rm -Rf "$path"
fi
done
}
# Clear variables # Clear variables
aurconf='/usr/local/etc/Maat/aur.list' aurconf='/usr/local/etc/Maat/aur.list'
baseurl='https://aninix.net/AniNIX' baseurl='https://aninix.net/AniNIX'
@ -164,26 +150,12 @@ timeout="90s"
# Stat tracking # Stat tracking
starttime=`date +%s` starttime=`date +%s`
function usage() {
### Show helptext
# param retcode: what to exit
retcode="$1"
cat <<EOM
Usage: $0
$0 -T # Extended testing
$0 -b homedir -c aurconf -u user -t timeout
Add -s to skip patching or -v for verbosity.
EOM
exit $retcode
}
# Parse arguments # Parse arguments
while getopts 'b:c:hil:st:Tu:v' OPTION; do while getopts 'b:c:hil:st:Tu:v' OPTION; do
case "${OPTION}" in case "${OPTION}" in
b) homedir="${OPTARG}" ;; b) homedir="${OPTARG}" ;;
c) aurconf="${OPTARG}" ;; c) aurconf="${OPTARG}" ;;
h) usage; exit 0 ;; h) Usage; exit 0 ;;
i) incremental=1 ;; i) incremental=1 ;;
l) cmdstring="$0"; for arg in $@; do if [ "$arg" != "-l" ] && [ "$arg" != "${OPTARG}" ]; then cmdstring="$cmdstring \"${arg}\""; fi; done; exec /bin/bash -c "$cmdstring | tee -a \"${OPTARG}\""; ;; l) cmdstring="$0"; for arg in $@; do if [ "$arg" != "-l" ] && [ "$arg" != "${OPTARG}" ]; then cmdstring="$cmdstring \"${arg}\""; fi; done; exec /bin/bash -c "$cmdstring | tee -a \"${OPTARG}\""; ;;
s) skipPatching=1 ;; s) skipPatching=1 ;;
@ -191,7 +163,7 @@ while getopts 'b:c:hil:st:Tu:v' OPTION; do
T) export MAATTESTINGVAR=1; exec $0 -l ./testing.log -u "$deprivuser" -v -s -c <(echo https://aur.archlinux.org/ascii-invaders.git) -b . ;; T) export MAATTESTINGVAR=1; exec $0 -l ./testing.log -u "$deprivuser" -v -s -c <(echo https://aur.archlinux.org/ascii-invaders.git) -b . ;;
u) deprivuser="${OPTARG}" ;; u) deprivuser="${OPTARG}" ;;
v) set -x ;; v) set -x ;;
*) echo "Internal GitOps CI/CD Pipeline"; usage 1 ;; *) usage; exit 1 ;;
esac esac
done done
@ -224,8 +196,7 @@ SeedWebFile
if [ -n "$MAATTESTINGVAR" ]; then if [ -n "$MAATTESTINGVAR" ]; then
BuildRepo "$baseurl"/HelloWorld BuildRepo "$baseurl"/HelloWorld
else else
CleanSrcTracking for AniNIXrepo in `curl -s "$baseurl" | grep 'class="name"' | cut -f 4 -d \" | sed "s#^#https://$(echo "$baseurl" | cut -f 3 -d /)#" | sed 's/$/.git/'`; do
for AniNIXrepo in `curl -s "$baseurl" | grep 'class="text primary name"' | cut -f 4 -d \" | sed "s#^#https://$(echo "$baseurl" | cut -f 3 -d /)#" | sed 's/$/.git/'`; do
BuildRepo "$AniNIXrepo" '.' BuildRepo "$AniNIXrepo" '.'
done done
fi fi

View File

@ -1,3 +0,0 @@
#!/bin/bash
make extendedtest