From cf8afc7fb0218124b019756ed12b87d0406ce008 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 03:34:20 +0000 Subject: [PATCH 1/4] Bump dependabot/fetch-metadata from 1.6.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.6.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.6.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/after-merge-dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/after-merge-dependabot.yml b/.github/workflows/after-merge-dependabot.yml index b1805fa..0d9ce87 100644 --- a/.github/workflows/after-merge-dependabot.yml +++ b/.github/workflows/after-merge-dependabot.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Fetch dependabot metadata id: dependabot-metadata - uses: dependabot/fetch-metadata@v1.6.0 + uses: dependabot/fetch-metadata@v2.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From a6418bcfa06dcad68c94fedd7e14a45aa7c3d5d7 Mon Sep 17 00:00:00 2001 From: Adams Pierre David Date: Mon, 6 May 2024 12:29:00 +0200 Subject: [PATCH 2/4] Added dockerfile (test) --- Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c0df779 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Stage 1 +FROM golang:1.22 as builder +WORKDIR /go/src/app +COPY . . +RUN go mod tidy +RUN go mod vendor +RUN CGO_ENABLED=0 go build -o /go/bin/app/credhub_exporter -a -tags netgo -ldflags '-w -extldflags "-static"' + +# Stage 2 +FROM alpine:3.19 +RUN apk add --no-cache ca-certificates +COPY --from=builder /go/bin/app/credhub_exporter /bin/credhub_exporter +EXPOSE 9358 +ENTRYPOINT ["/bin/credhub_exporter"] From a06e6b999c54e0fd702c662b243114b2a407bbb1 Mon Sep 17 00:00:00 2001 From: Romain Dartigues Date: Tue, 14 May 2024 16:09:45 +0200 Subject: [PATCH 3/4] CI: upgrade go to 1.22 --- .github/workflows/goreleaser.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 296ad1c..7dd5cb3 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -22,7 +22,7 @@ jobs: - name: set up go uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" - name: cache go modules uses: actions/cache@v4 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a2008b0..c100e86 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -16,7 +16,7 @@ jobs: - name: set up go uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" - name: cache go modules uses: actions/cache@v4 From c25d42a8daf19740782476c8b618681cea3c5a1e Mon Sep 17 00:00:00 2001 From: Romain Dartigues Date: Tue, 14 May 2024 16:22:00 +0200 Subject: [PATCH 4/4] CI: publish to DockerHub https://hub.docker.com/r/orangeopensource/credhub-exporter --- .github/workflows/main.yml | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..66f3577 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +name: build-and-release + +on: + push: + branches: + - '!*' + tags: + - 'v[0-9].*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Compute docker tags + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v5 + with: + images: orangeopensource/credhub-exporter + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Publish to DockerHub + uses: docker/build-push-action@v5 + with: + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + + - name: Create github release + id: create-github-release + if: success() && startsWith(github.ref, 'refs/tags/') + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + Resource image available: + ``` + ${{ steps.docker_meta.outputs.tags }} + ``` + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}