diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 17f7564..8251785 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: tags: - "[0-9].[0-9]+.[0-9]+" +env: + IMAGE: zappi/resque-exporter + jobs: github-release: runs-on: ubuntu-latest @@ -48,3 +51,43 @@ jobs: md5sum: true sha256sum: true asset_name: resque-exporter-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }} + + docker-hub-release: + runs-on: ubuntu-latest + needs: release-binaries + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Prepare Image Metadata + id: metadata + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE }} + - name: Set Up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set Up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login To Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + - name: Build, tag, and push image to Docker Hub + uses: docker/build-push-action@v6 + with: + build-args: + RESQUE_EXPORTER_VERSION=${{ github.ref_name }} + cache-from: type=gha + cache-to: type=gha,mode=max + context: . + platforms: linux/amd64,linux/arm64 + push: true + annotations: ${{ steps.metadata.outputs.annotations }} + labels: ${{ steps.metadata.outputs.labels }} + tags: ${{ steps.metadata.outputs.tags }} + - name: Update Description On Docker Hub Description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + repository: ${{ env.IMAGE }} diff --git a/.promu.yml b/.promu.yml deleted file mode 100644 index 31db445..0000000 --- a/.promu.yml +++ /dev/null @@ -1,15 +0,0 @@ -repository: - path: github.com/Intellection/resque-exporter -build: - binaries: - - name: resque-exporter - flags: -a -tags netgo - ldflags: | - -X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}} - -X {{repoPath}}/vendor/github.com/prometheus/common/version.Revision={{.Revision}} - -X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}} - -X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildUser={{user}}@{{host}} - -X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} -tarball: - files: - - LICENSE diff --git a/CHANGELOG.md b/CHANGELOG.md index e19ea1a..3b618c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.4.0 + +* Migrate from Dep to Go modules. +* Remove vendored packages. +* Upgrade `github.com/prometheus/client_golang` to `v1.20.4`. +* Upgrade `github.com/prometheus/common` to `v0.60.1`. +* Switch from `github.com/prometheus/common/log` to `github.com/sirupsen/logrus`. +* Improve setting and fetching of version information. +* Minor updates to account for package upgrades. + ## 0.3.0 #### Changed diff --git a/Dockerfile b/Dockerfile index b594233..03d7992 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,27 @@ -FROM quay.io/prometheus/golang-builder as builder +FROM ubuntu:24.04 AS builder -COPY . $GOPATH/src/github.com/Intellection/resque-exporter -WORKDIR $GOPATH/src/github.com/Intellection/resque-exporter +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH +ARG TARGETOS -RUN make PREFIX=/ +RUN apt-get update -qq -y && \ + apt-get install --no-install-recommends -qq -y \ + ca-certificates \ + wget && \ + rm -rf /var/lib/apt/lists/* -FROM quay.io/prometheus/busybox -MAINTAINER Satoshi Matsumoto +ARG RESQUE_EXPORTER_VERSION +ARG RESQUE_EXPORTER_PKG="resque-exporter-${RESQUE_EXPORTER_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz" +RUN cd /tmp/ && \ + wget --progress=dot:giga https://github.com/Intellection/resque-exporter/releases/download/${RESQUE_EXPORTER_VERSION}/${RESQUE_EXPORTER_PKG} && \ + wget --progress=dot:giga https://github.com/Intellection/resque-exporter/releases/download/${RESQUE_EXPORTER_VERSION}/${RESQUE_EXPORTER_PKG}.sha256 && \ + echo "$(cat ${RESQUE_EXPORTER_PKG}.sha256) *${RESQUE_EXPORTER_PKG}" | sha256sum -c - && \ + tar --no-same-owner -xzf ${RESQUE_EXPORTER_PKG} -COPY --from=builder /resque-exporter /bin/resque-exporter +FROM ubuntu:24.04 -USER nobody:nogroup +COPY --from=builder /tmp/resque-exporter /bin/resque-exporter +USER nobody:nogroup EXPOSE 9447 ENTRYPOINT ["/bin/resque-exporter"]