Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/go.yml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
---
name: Go
name: Build

on: [push]

jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- name: Lint Dockerfile
uses: hadolint/hadolint-action@master
with:
dockerfile: "Dockerfile"
mod-tidy:
name: mod-tidy
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v2.4.0
- name: set up go
uses: actions/setup-go@v2
uses: actions/setup-go@v2.2.0
with:
go-version: 1.15.6
go-version: 1.17.7
id: go
- name: go mod tidy
run: go mod tidy
Expand All @@ -26,12 +36,13 @@ jobs:
needs: [mod-tidy]
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v2.4.0
- name: set up go
uses: actions/setup-go@v2
uses: actions/setup-go@v2.2.0
with:
go-version: 1.15.6
go-version: 1.17.7
id: go
- run: go version
- name: Promu
run: make promu
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
verbose: false
go:
version: 1.16.3
version: 1.17.7
repository:
path: github.com/rnaveiras/postgres_exporter
build:
Expand Down
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM golang:1.16-alpine3.12 as builder
# syntax=docker/dockerfile:1
FROM golang:1.17.7-alpine3.15 as builder

ENV PROMU_SHA256=17d991fea8e992636272d9b4e24b72c104d305ed1460d40891894fae6b6c64a2 \
PROMU_VERSION=0.12.0
ENV PROMU_SHA256=41bdeadd6bb761058adc82e1c0fc9951ca3eac9d0556d29bdf01993f7afd1f57 \
PROMU_VERSION=0.13.0

RUN set -x \
&& apk --no-cache add curl ca-certificates git \
SHELL ["/bin/ash", "-euox", "pipefail", "-c"]

# hadolint ignore=DL3018
RUN apk --no-cache add curl ca-certificates git \
&& curl -o /tmp/promu.tar.gz -fsL https://github.com/prometheus/promu/releases/download/v${PROMU_VERSION}/promu-${PROMU_VERSION}.linux-amd64.tar.gz \
&& echo "${PROMU_SHA256} /tmp/promu.tar.gz" | sha256sum -c \
&& tar xvfz /tmp/promu.tar.gz -C /tmp \
Expand All @@ -19,7 +22,7 @@ RUN set -x \
&& promu build --verbose --prefix=./output \
&& find ./output

FROM alpine:3.12
FROM alpine:3.15
LABEL maintainer="Raul Naveiras <rnaveiras@gmail.com>"

COPY --from=builder /go/src/app/output/postgres_exporter /bin/postgres_exporter
Expand Down