containers/.gitlab-ci.yml
2024-03-06 21:22:09 -06:00

50 lines
2.8 KiB
YAML

stages:
- build
fedora-build-job:
stage: build
tags:
- shell-exec
variables:
FQ_IMAGE_NAME: "$CI_REGISTRY_IMAGE/fedora:latest"
before_script:
- buildah rm --all
- buildah prune -af
- buildah login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- container=$(buildah from registry.fedoraproject.org/fedora:latest)
- buildah run $container -- sh -c 'printf "fastestmirror=True\ndeltarpm=True\n" | tee -a /etc/dnf/dnf.conf'
- buildah run $container -- dnf update -y
- buildah run $container -- dnf install -y '@container-management' '@development-tools' '@c-development' container-selinux ostree rpm-ostree rsync
- buildah run $container -- dnf clean all
- buildah commit --squash --rm $container "$FQ_IMAGE_NAME"
- buildah push "$FQ_IMAGE_NAME"
fedora-distrobox-build-job:
stage: build
tags:
- shell-exec
variables:
NU_RELEASE: "0.91.0"
FQ_IMAGE_NAME: "$CI_REGISTRY_IMAGE/fedora-distrobox:39"
before_script:
- buildah rm --all
- buildah prune -af
- buildah login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- container=$(buildah from registry.fedoraproject.org/fedora-toolbox:39)
- buildah run $container -- sh -c 'printf "fastestmirror=True\ndeltarpm=True\n" | tee -a /etc/dnf/dnf.conf'
- buildah run $container -- dnf update -y
- buildah run $container -- dnf copr enable -y varlad/zellij
- buildah run $container -- dnf copr enable -y atim/starship
- buildah run $container -- sh -c 'printf "[charm]\nname=Charm\nbaseurl=https://repo.charm.sh/yum/\nenabled=1\ngpgcheck=1\ngpgkey=https://repo.charm.sh/yum/gpg.key\n" | tee /etc/yum.repos.d/charm.repo'
- buildah run $container -- dnf install -y '@c-development' '@development-tools' ShellCheck autossh bat btop charm cmake diff-so-fancy emacs fd-find fzf git git-core glow golang gum htop httpie hugo hyperfine jc jq just lsd lsof neofetch nodejs npm openssl-devel pass perl-Image-ExifTool pipx procs pv python3-devel python3-pip ranger ripgrep rsync shfmt starship tealdeer trash-cli vim-default-editor w3m wget xclip xsel zellij zsh --allowerasing
- buildah run $container -- dnf clean all
- buildah run $container -- wget "https://github.com/nushell/nushell/releases/download/${NU_RELEASE}/nu-${NU_RELEASE}-x86_64-linux-gnu-full.tar.gz" -O /tmp/nu.tar.gz
- buildah run $container -- tar xvf /tmp/nu.tar.gz -C /tmp
- buildah run $container -- cp -v "/tmp/nu-${NU_RELEASE}-x86_64-linux-gnu-full/nu*" /usr/local/bin/
- buildah run $container -- sh -c 'echo "/usr/local/bin/nu" | tee -a /etc/shells'
- buildah run $container -- /usr/local/bin/nu -c 'register /usr/local/bin/nu_plugin_formats'
- buildah commit --squash --rm $container "$FQ_IMAGE_NAME"
- buildah push "$FQ_IMAGE_NAME"