Skip to content

Commit 94a3d29

Browse files
authored
feat: Add the sm-k6-gsm binary for secrets (#1234)
* feat: Add the sm-k6-gsm binary for secrets Depends on grafana/xk6-sm#74 * fix: Add the gsm binary to packages also
1 parent ad3ffbb commit 94a3d29

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ARG HOST_DIST=$TARGETOS-$TARGETARCH
2424
RUN adduser -D -u 12345 -g 12345 sm
2525

2626
ADD --chown=sm:sm --chmod=0500 https://github.com/grafana/xk6-sm/releases/download/v0.0.3-pre/sm-k6-${TARGETOS}-${TARGETARCH} /usr/local/bin/sm-k6
27+
ADD --chown=sm:sm --chmod=0500 https://github.com/grafana/xk6-sm/releases/download/v0.4.0/sm-k6-${TARGETOS}-${TARGETARCH}-gsm /usr/local/bin/sm-k6-gsm
2728
COPY --chown=sm:sm --chmod=0500 --from=setcapper /usr/local/bin/synthetic-monitoring-agent /usr/local/bin/synthetic-monitoring-agent
2829
COPY --chown=sm:sm scripts/pre-stop.sh /usr/local/lib/synthetic-monitoring-agent/pre-stop.sh
2930
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
@@ -39,6 +40,7 @@ RUN adduser -D -u 12345 -g 12345 sm
3940

4041
COPY --from=release --chown=sm:sm /usr/local/bin/synthetic-monitoring-agent /usr/local/bin/synthetic-monitoring-agent
4142
COPY --from=release --chown=sm:sm /usr/local/bin/sm-k6 /usr/local/bin/sm-k6
43+
COPY --from=release --chown=sm:sm /usr/local/bin/sm-k6-gsm /usr/local/bin/sm-k6-gsm
4244
COPY --from=release /usr/local/lib/synthetic-monitoring-agent/pre-stop.sh /usr/local/lib/synthetic-monitoring-agent/pre-stop.sh
4345
COPY --from=release /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
4446

Dockerfile.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ARG HOST_DIST=$TARGETOS-$TARGETARCH
2424
RUN adduser -D -u 12345 -g 12345 sm
2525

2626
ADD --chown=sm:sm --chmod=0500 https://github.com/grafana/xk6-sm/releases/download/v0.0.3-pre/sm-k6-${TARGETOS}-${TARGETARCH} /usr/local/bin/sm-k6
27+
ADD --chown=sm:sm --chmod=0500 https://github.com/grafana/xk6-sm/releases/download/v0.4.0/sm-k6-${TARGETOS}-${TARGETARCH}-gsm /usr/local/bin/sm-k6-gsm
2728
COPY --chown=sm:sm --chmod=0500 --from=setcapper /usr/local/bin/synthetic-monitoring-agent /usr/local/bin/synthetic-monitoring-agent
2829
COPY --chown=sm:sm scripts/pre-stop.sh /usr/local/lib/synthetic-monitoring-agent/pre-stop.sh
2930
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
@@ -39,6 +40,7 @@ RUN adduser -D -u 12345 -g 12345 sm
3940

4041
COPY --from=release --chown=sm:sm /usr/local/bin/synthetic-monitoring-agent /usr/local/bin/synthetic-monitoring-agent
4142
COPY --from=release --chown=sm:sm /usr/local/bin/sm-k6 /usr/local/bin/sm-k6
43+
COPY --from=release --chown=sm:sm /usr/local/bin/sm-k6-gsm /usr/local/bin/sm-k6-gsm
4244
COPY --from=release /usr/local/lib/synthetic-monitoring-agent/pre-stop.sh /usr/local/lib/synthetic-monitoring-agent/pre-stop.sh
4345
COPY --from=release /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
4446

scripts/make/sm-k6.mk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ $(DISTDIR)/$(1)-$(2)/sm-k6:
1111
curl -sSL https://github.com/grafana/xk6-sm/releases/download/v0.0.3/sm-k6-$(1)-$(2) -o "$$@"
1212
chmod +x "$$@"
1313

14-
sm-k6: $(DISTDIR)/$(1)-$(2)/sm-k6
14+
$(DISTDIR)/$(1)-$(2)/sm-k6-gsm:
15+
mkdir -p "$(DISTDIR)/$(1)-$(2)"
16+
# Renovate updates the following line. Keep its syntax as it is.
17+
curl -sSL https://github.com/grafana/xk6-sm/releases/download/v0.4.0/sm-k6-$(1)-$(2)-gsm -o "$$@"
18+
chmod +x "$$@"
19+
20+
sm-k6: $(DISTDIR)/$(1)-$(2)/sm-k6 $(DISTDIR)/$(1)-$(2)/sm-k6-gsm
1521
endef
1622

1723
$(foreach BUILD_PLATFORM,$(XK6_PLATFORMS), \
1824
$(eval $(call sm-k6,$(word 1,$(subst /, ,$(BUILD_PLATFORM))),$(word 2,$(subst /, ,$(BUILD_PLATFORM))))))
1925

2026
.PHONY: sm-k6-native
21-
sm-k6-native: $(DISTDIR)/$(HOST_OS)-$(HOST_ARCH)/sm-k6
27+
sm-k6-native: $(DISTDIR)/$(HOST_OS)-$(HOST_ARCH)/sm-k6 $(DISTDIR)/$(HOST_OS)-$(HOST_ARCH)/sm-k6-gsm

scripts/package/nfpm.yaml.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ contents:
2323
# Copy k6 as sm-k6 to prevent clashing with k6 if it's installed.
2424
- src: {{.DISTDIR}}/{{.Os}}-{{.Arch}}/sm-k6
2525
dst: /usr/bin/sm-k6
26+
- src: {{.DISTDIR}}/{{.Os}}-{{.Arch}}/sm-k6-gsm
27+
dst: /usr/bin/sm-k6-gsm
2628
rpm:
2729
deb:

0 commit comments

Comments
 (0)