|
| 1 | +package: |
| 2 | + name: prometheus-3.8 |
| 3 | + version: "3.8.0" |
| 4 | + epoch: 0 # CVE-2025-61729 |
| 5 | + description: The Prometheus monitoring system and time series database. |
| 6 | + copyright: |
| 7 | + - license: Apache-2.0 |
| 8 | + dependencies: |
| 9 | + provides: |
| 10 | + - prometheus=${{package.full-version}} |
| 11 | + runtime: |
| 12 | + - merged-usrsbin |
| 13 | + - wolfi-baselayout |
| 14 | + |
| 15 | +environment: |
| 16 | + contents: |
| 17 | + packages: |
| 18 | + - bash |
| 19 | + - busybox |
| 20 | + - ca-certificates-bundle |
| 21 | + - go |
| 22 | + - nodejs |
| 23 | + - npm |
| 24 | + |
| 25 | +var-transforms: |
| 26 | + - from: ${{package.version}} |
| 27 | + match: ^(\d+).* |
| 28 | + replace: $1 |
| 29 | + to: major-version |
| 30 | + |
| 31 | +pipeline: |
| 32 | + - uses: git-checkout |
| 33 | + with: |
| 34 | + expected-commit: 21ff54afb235cf395ecb65dc1a7a8f6ce4f2af9d |
| 35 | + repository: https://github.com/prometheus/prometheus |
| 36 | + tag: v${{package.version}} |
| 37 | + |
| 38 | + - uses: go/bump |
| 39 | + with: |
| 40 | + deps: |- |
| 41 | + golang.org/x/crypto@v0.45.0 |
| 42 | +
|
| 43 | + - uses: go/bump |
| 44 | + with: |
| 45 | + deps: |- |
| 46 | + golang.org/x/crypto@v0.45.0 |
| 47 | + modroot: documentation/examples/remote_storage |
| 48 | + |
| 49 | + - uses: patch |
| 50 | + with: |
| 51 | + patches: disable-pprof.patch |
| 52 | + |
| 53 | + - runs: | |
| 54 | + GOLDFLAGS="-X github.com/prometheus/common/version.Version=${{package.version}} |
| 55 | + -X github.com/prometheus/common/version.Revision=WolfiLinux |
| 56 | + -X github.com/prometheus/common/version.Branch=master |
| 57 | + -X github.com/prometheus/common/version.BuildUser=$USER@$(hostname) |
| 58 | + -X github.com/prometheus/common/version.BuildDate=$(date -u "+%Y%m%d-%H:%M:%S" ${SOURCE_DATE_EPOCH:+-d @$SOURCE_DATE_EPOCH}) |
| 59 | + " |
| 60 | + if [ -n "$LDFLAGS" ]; then |
| 61 | + # LDFLAGS (and only LDFLAGS) should be passed to -extldflags. |
| 62 | + GOLDFLAGS="$GOLDFLAGS -extldflags '$LDFLAGS'" |
| 63 | + fi |
| 64 | +
|
| 65 | + # set -j1 to run things in the correct order in makefile |
| 66 | + # actual go building is still parallel |
| 67 | + make -j1 assets-compress |
| 68 | +
|
| 69 | + go build \ |
| 70 | + -trimpath \ |
| 71 | + -mod=readonly \ |
| 72 | + -ldflags "$GOLDFLAGS" \ |
| 73 | + -tags netgo,builtinassets \ |
| 74 | + ./cmd/prometheus |
| 75 | + go build \ |
| 76 | + -trimpath \ |
| 77 | + -mod=readonly \ |
| 78 | + -ldflags "$GOLDFLAGS" \ |
| 79 | + ./cmd/promtool |
| 80 | +
|
| 81 | + - runs: | |
| 82 | + install -Dm755 prometheus "${{targets.destdir}}"/usr/bin/prometheus |
| 83 | + install -Dm755 promtool "${{targets.destdir}}"/usr/bin/promtool |
| 84 | +
|
| 85 | + install -Dm644 prometheus.confd \ |
| 86 | + "${{targets.destdir}}"/etc/conf.d/prometheus |
| 87 | +
|
| 88 | + install -dm644 "${{targets.destdir}}"/var/lib/prometheus/data |
| 89 | +
|
| 90 | + install -Dm644 -t "${{targets.destdir}}"/etc/prometheus \ |
| 91 | + documentation/examples/prometheus.yml |
| 92 | +
|
| 93 | +subpackages: |
| 94 | + - name: ${{package.name}}-iamguarded-compat |
| 95 | + dependencies: |
| 96 | + runtime: |
| 97 | + - ${{package.name}} |
| 98 | + provides: |
| 99 | + - prometheus-iamguarded-compat=${{package.full-version}} |
| 100 | + description: "compat package for iamguarded" |
| 101 | + pipeline: |
| 102 | + - uses: iamguarded/build-compat |
| 103 | + with: |
| 104 | + package: prometheus |
| 105 | + version: ${{vars.major-version}} |
| 106 | + - runs: | |
| 107 | + mkdir -p /opt/iamguarded/prometheus/bin/ |
| 108 | + mkdir -p /opt/iamguarded/prometheus/conf |
| 109 | + mkdir -p /opt/iamguarded/prometheus/data |
| 110 | +
|
| 111 | + chmod g+rwX /opt/iamguarded |
| 112 | +
|
| 113 | + ln -sf /usr/bin/prometheus /opt/iamguarded/prometheus/bin/prometheus |
| 114 | + ln -sf /usr/bin/promtool /opt/iamguarded/prometheus/bin/promtool |
| 115 | + cp -r ${{targets.destdir}}/etc/prometheus/* /opt/iamguarded/prometheus/conf/ |
| 116 | + cp -r ${{targets.destdir}}/var/lib/prometheus/data /opt/iamguarded/prometheus/data |
| 117 | + - uses: iamguarded/finalize-compat |
| 118 | + with: |
| 119 | + package: prometheus |
| 120 | + version: ${{vars.major-version}} |
| 121 | + test: |
| 122 | + pipeline: |
| 123 | + - runs: | |
| 124 | + stat /opt/iamguarded/prometheus/bin/prometheus |
| 125 | + stat /opt/iamguarded/prometheus/bin/promtool |
| 126 | + /opt/iamguarded/prometheus/bin/prometheus --version |
| 127 | + /opt/iamguarded/prometheus/bin/promtool --version |
| 128 | + - uses: iamguarded/test-compat |
| 129 | + with: |
| 130 | + package: prometheus |
| 131 | + version: ${{vars.major-version}} |
| 132 | + |
| 133 | +update: |
| 134 | + ignore-regex-patterns: |
| 135 | + - '\+stringlabels' # looks like stringlabels are still experimental, let's stick to the main version stream. |
| 136 | + enabled: true |
| 137 | + github: |
| 138 | + identifier: prometheus/prometheus |
| 139 | + strip-prefix: v |
| 140 | + tag-filter-prefix: v3.8 |
| 141 | + |
| 142 | +test: |
| 143 | + environment: |
| 144 | + contents: |
| 145 | + packages: |
| 146 | + - curl |
| 147 | + pipeline: |
| 148 | + - name: Check Prometheus Rules |
| 149 | + runs: | |
| 150 | + cat << 'EOF' > rules.example |
| 151 | + groups: |
| 152 | + - name: http |
| 153 | + rules: |
| 154 | + - record: job:http_inprogress_requests:sum |
| 155 | + expr: sum(http_inprogress_requests) by (job) |
| 156 | + EOF |
| 157 | + promtool check rules rules.example |
| 158 | + prometheus --version |
| 159 | + prometheus --help |
| 160 | + promtool --version |
| 161 | + promtool --help |
| 162 | + - name: Verify Prometheus Installation and Server Running Capability |
| 163 | + runs: | |
| 164 | + cat << 'EOF' > prometheus.yml |
| 165 | + global: |
| 166 | + scrape_interval: 15s |
| 167 | +
|
| 168 | + scrape_configs: |
| 169 | + - job_name: "prometheus" |
| 170 | + static_configs: |
| 171 | + - targets: ["localhost:9090"] |
| 172 | + EOF |
| 173 | + prometheus --config.file=./prometheus.yml --web.listen-address=127.0.0.1:9090 > /dev/null 2>&1 & |
| 174 | + sleep 5 |
| 175 | + curl -s "http://127.0.0.1:9090/-/healthy" | grep -q "Prometheus Server is Healthy." |
0 commit comments