Skip to content

Commit 8fd95bb

Browse files
committed
point to tetrate, tweak ci with custom publish release images job, readme
1 parent 320b684 commit 8fd95bb

File tree

4 files changed

+59
-18
lines changed

4 files changed

+59
-18
lines changed

.circleci/config.yml

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ jobs:
4545
- run: make build
4646
- run: make test
4747

48+
# Customized publish job to use our docker variables and just build/publish images, not cutting github releases.
49+
# See:
50+
# - https://circleci.com/developer/orbs/orb/prometheus/prometheus
51+
# - https://github.com/prometheus/circleci
52+
publish_images:
53+
docker:
54+
- image: cimg/go:1.24
55+
steps:
56+
- prometheus/setup_build_environment:
57+
docker_version: ""
58+
- prometheus/publish_release_images:
59+
registry: docker.io
60+
organization: tetrate
61+
login_variable: DOCKER_USER
62+
password_variable: DOCKER_PASS
63+
4864
workflows:
4965
version: 2
5066
postgres_exporter:
@@ -81,25 +97,36 @@ workflows:
8197
only: /^(main|master|release-.*|.*build-all.*)$/
8298
tags:
8399
only: /^v.*/
84-
- prometheus/publish_master:
85-
context: org-context
86-
docker_hub_organization: prometheuscommunity
87-
quay_io_organization: prometheuscommunity
88-
requires:
89-
- test
90-
- build_all
91-
filters:
92-
branches:
93-
only: master
94-
- prometheus/publish_release:
95-
context: org-context
96-
docker_hub_organization: prometheuscommunity
97-
quay_io_organization: prometheuscommunity
100+
# Build and publish images to the tetrate container image registry.
101+
- publish_images:
102+
context: org-global
98103
requires:
99-
- test
100-
- build_all
104+
- test
105+
- build_all
101106
filters:
102107
tags:
103108
only: /^v.*/
104109
branches:
105110
ignore: /.*/
111+
# - prometheus/publish_master:
112+
# context: org-context
113+
# docker_hub_organization: prometheuscommunity
114+
# quay_io_organization: prometheuscommunity
115+
# requires:
116+
# - test
117+
# - build_all
118+
# filters:
119+
# branches:
120+
# only: master
121+
# - prometheus/publish_release:
122+
# context: org-context
123+
# docker_hub_organization: prometheuscommunity
124+
# # quay_io_organization: prometheuscommunity
125+
# requires:
126+
# - test
127+
# - build_all
128+
# filters:
129+
# tags:
130+
# only: /^v.*/
131+
# branches:
132+
# ignore: /.*/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ all::
33

44
# Needs to be defined before including Makefile.common to auto-generate targets
55
DOCKER_ARCHS ?= amd64 armv7 arm64 ppc64le
6-
DOCKER_REPO ?= prometheuscommunity
6+
DOCKER_REPO ?= tetrate
77

88
include Makefile.common
99

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,17 @@ docker run -p 5432:5432 -e POSTGRES_DB=circle_test -e POSTGRES_USER=postgres -e
445445
# Run the integration tests
446446
DATA_SOURCE_NAME='postgresql://postgres:test@localhost:5432/circle_test?sslmode=disable' GOOPTS='-v -tags integration' make test
447447
```
448+
449+
# **Tetrate CVE builds**
450+
Upstream is not fixing CVEs reported by security scanners, but not applicable to postgres_exporter image.
451+
These false positives can be fixed by cutting tetrate specific patch releases as follows:
452+
- Push a commit to a release branch in our fork (e.g. `release-v0.18.1` branch) with the changes to fix the CVEs.
453+
- Include changes to the `VERSION` file to the new version name following the pattern `<current-version>-tetrate-v<patch-number>`. For example `0.18.1-tetrate-v0` is the first CVEs fixing patch for `0.18.1`.
454+
- Once the PR is approved and merged:
455+
- Create the tag and push it to the repository following the pattern `v<new-version>`. For example `v0.18.1-tetrate-v0`.
456+
- CircleCI will automatically build the images and push them to the [tetrate docker hub repository](https://hub.docker.com/r/tetrate/postgres-exporter).
457+
- Update tetrate repository to use the new image version.
458+
Further details for troubleshooting:
459+
- tag push triggers the `publish_images` custom job in CircleCI that can be found in the `.circleci/config.yml` file.
460+
- This job uses the [prometheus/publish_release_images](https://circleci.com/developer/orbs/orb/prometheus/publish_release_images) CircleCI orb.
461+
- CircleCI job details can be found in the [CircleCI dashboard for this project](https://app.circleci.com/projects/github/tetrateio/postgres_exporter).

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.18.1
1+
0.18.1-tetrate-v0

0 commit comments

Comments
 (0)