arch/build-pkg/build-pkg-docker.sh

69 lines
2.4 KiB
Bash
Raw Normal View History

2021-05-13 15:44:34 +02:00
#!/usr/bin/env bash
function is-installed() {
type "${1}"
}
function start-docker() {
is-installed "systemctl" || return $?
is-installed "docker" || return $?
res="$(systemctl show --property ActiveState docker)" || return $?
case "${res}" in
"ActiveState=active")
# Docker service is active
2021-05-13 17:14:49 +02:00
true
;;
2021-05-13 15:44:34 +02:00
"ActiveState=inactive")
# Docker service is inactive -> Let's start it
echo "Starting docker service ..."
sudo systemctl start docker || return $?
2021-05-13 17:14:49 +02:00
sleep 5s
2021-05-13 15:44:34 +02:00
;;
*)
echo "Unknown state or error!"
return 1
esac
}
function build-pkg() {
2021-05-13 19:13:19 +02:00
# --rm: Remove container after run.
sudo docker-compose run --rm makepkg "${1}"
2021-05-13 15:44:34 +02:00
}
2021-05-13 17:14:49 +02:00
function push-pkg() {
arch-repo-push-new || return $? # Push remote repository
}
function build-and-push() {
for PKG in "$@"; do
build-pkg "${PKG}" || return $?
done
push-pkg || return $?
}
2021-05-13 15:44:34 +02:00
function main() {
start-docker || return $?
is-installed "docker-compose" || return $?
2021-05-13 17:14:49 +02:00
# PKGS=(xorg-meta de-p1st-systemd de-p1st-sudo de-p1st-screen de-p1st-pacman de-p1st-pacman-mirrorlist de-p1st-networkmanager de-p1st-ucode-placeholder de-p1st-ucode-intel de-p1st-ucode-amd de-p1st-nano de-p1st-mkinitcpio de-p1st-makepkg de-p1st-grub de-p1st-font de-p1st-keyboard-de de-p1st-keyboard-x11-de de-p1st-gnupg de-p1st-redshift de-p1st-theme de-p1st-gpu-generic de-p1st-gpu-amdgpu de-p1st-installer de-p1st-repo)
# for PKG in "${PKGS[@]}"; do
# build-pkg "${PKG}" || return $?
# done
# Stage1
2021-05-14 14:27:39 +02:00
build-and-push xorg-meta de-p1st-locale de-p1st-systemd de-p1st-sudo de-p1st-screen de-p1st-htop de-p1st-pacman de-p1st-pacman-mirrorlist de-p1st-networkmanager de-p1st-ucode-placeholder de-p1st-ucode-intel de-p1st-ucode-amd de-p1st-nano de-p1st-mkinitcpio de-p1st-makepkg de-p1st-grub de-p1st-font de-p1st-keyboard-de de-p1st-keyboard-x11-de de-p1st-gnupg de-p1st-redshift de-p1st-theme de-p1st-sddm-autologin-placeholder de-p1st-sddm-autologin-yoda de-p1st-sddm-theme-default de-p1st-sddm-theme-nordic de-p1st-gpu-generic de-p1st-gpu-amdgpu de-p1st-installer de-p1st-repo || return $?
2021-05-13 17:14:49 +02:00
# Stage2
build-and-push de-p1st-smartcard de-p1st-kernel-default de-p1st-kernel-lts de-p1st-dns || return $?
# Stage3
build-and-push de-p1st-base || return $?
# Stage4
build-and-push de-p1st-xfce4 || return $?
# Stage5
build-and-push de-p1st-xfce4-hidpi || return $?
2021-05-13 15:44:34 +02:00
echo "Successfully built all packages!"
}
main "$@"