Skip to content
Snippets Groups Projects
Earthfile 1.25 KiB
Newer Older
VERSION 0.7

ARG --global CONTAINER_REGISTRY=quay.io/shivering-isles

# Build all container images
images:
    BUILD +images-earthly
    BUILD +images-dockerfile

images-src:
    FROM quay.io/fedora/fedora:38
    COPY images/ ./images

images-earthly:
    FROM +images-src
    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

images-dockerfile:
    FROM +images-src
    FOR dir IN $(find ./images -type d -execdir test -f {}/Dockerfile -a \! -e {}/Earthfile -a \! -e {}/.skip-earthly \; -print)
        FROM DOCKERFILE -f "${dir}/Dockerfile" "${dir}"
        SAVE IMAGE "$CONTAINER_REGISTRY/$(basename ${dir})"
    END

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

# 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}