weatherlink-tools 0.1.0

Collects data from a Weatherlink Live device, sends it to MQTT or Prometheus
Documentation
image: debian/testing
packages:
- buildah
# required to avoid Dockerfile RUN errors around 'fork/exec : no such file or directory'
- podman
# both required to avoid Dockerfile RUN errors around 'Exec format error'
- binfmt-support
- qemu-user-static
secrets:
# creates /home/build/.docker/config.json
- 53238824-89f5-4c14-bd90-5e1be107dd85
environment:
  REPO_NAME: weatherlink-mqtt
  IMAGE_NAME: ghcr.io/nickbp/weatherlink-mqtt
  # Disable arm64 for now: Seeing 'Killed' in sourcehut build
  #IMAGE_PLATFORMS: linux/amd64,linux/arm64
  IMAGE_PLATFORMS: linux/amd64
  BUILDAH_FORMAT: docker # 'oci' default doesn't list architectures on hub.docker.com
tasks:
# build amd64+arm64 images
- docker: |
    # required to fix errors like "potentially insufficient UIDs or GIDs available in user namespace"
    sudo touch /etc/subuid /etc/subgid
    sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USER

    cd $REPO_NAME/
    GIT_REV="$(git rev-parse --short HEAD)"

    # build amd64+arm64 images to named manifest. requires buildah >=1.23.1 and takes a long time
    # see also https://podman.io/blogs/2021/10/11/multiarch.html
    buildah build --manifest "${REPO_NAME}_${GIT_REV}" --jobs=1 --platform="${IMAGE_PLATFORMS}" .

    # push manifest and built amd64+arm64 images to both rev and branch tags
    buildah manifest push --all "${REPO_NAME}_${GIT_REV}" "docker://${IMAGE_NAME}:${GIT_REV}"