|
36 | 36 | COPY --from=golang-image /usr/local/go/ /usr/local/go/ |
37 | 37 | ENV PATH="/usr/local/go/bin:${PATH}" |
38 | 38 |
|
| 39 | +COPY --chown=${STACKABLE_USER_UID}:0 shared/statsd-exporter/stackable/patches/patchable.toml /statsd_exporter/src/shared/statsd-exporter/stackable/patches/patchable.toml |
| 40 | +COPY --chown=${STACKABLE_USER_UID}:0 shared/statsd-exporter/stackable/patches/${PRODUCT_VERSION} /statsd_exporter/src/shared/statsd-exporter/stackable/patches/${PRODUCT_VERSION} |
| 41 | + |
39 | 42 | RUN --mount=type=cache,id=go-statsd-exporter,uid=${STACKABLE_USER_UID},target=/go_cache <<EOF |
40 | 43 | export GOPATH=/go_cache |
41 | 44 | go install "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v${CYCLONEDX_GOMOD_VERSION}" |
42 | 45 |
|
43 | | -curl "https://repo.stackable.tech/repository/packages/statsd_exporter/statsd_exporter-${PRODUCT_VERSION}.src.tar.gz" | tar -xzC . |
44 | 46 | ( |
45 | | - cd "statsd_exporter-${PRODUCT_VERSION}" || exit |
| 47 | + cd "$(/stackable/patchable --images-repo-root=src checkout shared/statsd-exporter ${PRODUCT_VERSION})" |
| 48 | + |
| 49 | + # Create snapshot of the source code including custom patches |
| 50 | + tar -czf /statsd_exporter/statsd-exporter-${PRODUCT_VERSION}-src.tar.gz . |
46 | 51 |
|
47 | 52 | # Unfortunately, we need to create a dummy Git repository to allow cyclonedx-gomod to determine the version of statsd_exporter |
| 53 | + rm .git |
48 | 54 | git init |
49 | 55 | git config user.email "fake.commiter@stackable.tech" |
50 | 56 | git config user.name "Fake commiter" |
51 | 57 | git commit --allow-empty --message "Fake commit, so that we can create a tag" |
52 | 58 | git tag "v${PRODUCT_VERSION}" |
53 | | - go build -o ../statsd_exporter |
54 | | - $GOPATH/bin/cyclonedx-gomod app -json -output-version 1.5 -output ../statsd_exporter-${PRODUCT_VERSION}.cdx.json -packages -files |
| 59 | + go build -o /statsd_exporter/statsd_exporter |
| 60 | + $GOPATH/bin/cyclonedx-gomod app -json -output-version 1.5 -output /statsd_exporter/statsd_exporter-${PRODUCT_VERSION}.cdx.json -packages -files |
55 | 61 | ) |
56 | 62 | rm -rf "statsd_exporter-${PRODUCT_VERSION}" |
| 63 | +# set correct groups |
| 64 | +chmod -R g=u /statsd_exporter/ |
57 | 65 | EOF |
0 commit comments