Skip to content
Snippets Groups Projects
Earthfile 1.68 KiB
Newer Older
VERSION --wait-block 0.7
# images builds all container images in the Repository
    ARG CONTAINER_REGISTRY=quay.io/shivering-isles
    BUILD +images-earthly --CONTAINER_REGISTRY=${CONTAINER_REGISTRY}
    FROM quay.io/fedora/fedora:39
    COPY images/ ./images

images-earthly:
    FROM +images-src
    ARG CONTAINER_REGISTRY=quay.io/shivering-isles
    FOR dir IN $(find ./images -type d -execdir test -f {}/Earthfile -a \! -e {}/.skip-earthly \; -print)
        BUILD "${dir}+container" --registry="$CONTAINER_REGISTRY/$(basename ${dir})"
    END

# changelog generates a local RELEASENOTES.md file using git-chglog
changelog:
  FROM quay.io/git-chglog/git-chglog:0.15.4
  COPY . /src
  WORKDIR /src
  RUN git-chglog --template .chglog/unreleased.tpl.md --next-tag "v$(date +%y.%m)" --output RELEASENOTES.md
  SAVE ARTIFACT RELEASENOTES.md AS LOCAL RELEASENOTES.md

# merge allows to merge branches in the origin remote, this helps to keep everything signed
merge:
    LOCALLY
    ARG --required branch
    RUN git fetch
    RUN git merge --no-ff origin/${branch} --no-edit
    RUN git push
    RUN git push origin --delete ${branch}

# rotate will rotate encryption keys in sops-encrypted files
rotate:
    LOCALLY
    RUN grep -Ril "sops:" ./**/*.yaml | xargs sops -r -i

# enable-autoupdates enables the fedora autoupdating form the system-upgrades namespace
enable-autoupdates:
    LOCALLY
    ARG --required node
    RUN kubectl label node "${node}" upgrade.shivering-isles.com/fedora-autoupdate=true

# docs runs a local mdbook instance using koolbox that will listen on localhost:3000
docs:
    WAIT
        BUILD ./images/koolbox+install
    END
    LOCALLY
    RUN koolbox mdbook serve docs