-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from grafana/1-k6exec-cli
feat: reintroduce k6exec CLI + Docker image
- Loading branch information
Showing
15 changed files
with
982 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
env: | ||
REGISTRY: ghcr.io | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22.2" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: "amd64,arm64" | ||
- name: Login to GitHub packages | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
distribution: goreleaser | ||
version: "2.0.1" | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
/node_modules | ||
/package.json | ||
/yarn.lock | ||
/coverage.txt | ||
/coverage.txt | ||
/k6exec | ||
/k6exec.exe | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
project_name: k6exec | ||
version: 2 | ||
env: | ||
- IMAGE_OWNER=ghcr.io/grafana | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: ["darwin", "linux", "windows"] | ||
goarch: ["amd64", "arm64"] | ||
ldflags: | ||
- "-s -w -X main.version={{.Version}} -X main.appname={{.ProjectName}}" | ||
dir: cmd/k6exec | ||
source: | ||
enabled: true | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_source" | ||
|
||
archives: | ||
- id: bundle | ||
format: tar.gz | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
checksum: | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" | ||
|
||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next+{{.ShortCommit}}{{if .IsGitDirty}}.dirty{{else}}{{end}}" | ||
|
||
changelog: | ||
sort: asc | ||
abbrev: -1 | ||
filters: | ||
exclude: | ||
- "^chore:" | ||
- "^docs:" | ||
- "^test:" | ||
|
||
git: | ||
ignore_tags: | ||
- "nightly" | ||
- "before-grafana" | ||
|
||
dockers: | ||
- id: amd64 | ||
dockerfile: Dockerfile.goreleaser | ||
use: buildx | ||
image_templates: | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:{{ .Tag }}-amd64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}-amd64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}-amd64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:latest-amd64" | ||
|
||
build_flag_templates: | ||
- "--platform=linux/amd64" | ||
- "--pull" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.title={{.ProjectName}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
- "--label=org.opencontainers.image.licenses=AGPL-3.0-only" | ||
- id: arm64 | ||
dockerfile: Dockerfile.goreleaser | ||
use: buildx | ||
image_templates: | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:{{ .Tag }}-arm64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}-arm64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}-arm64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:latest-arm64" | ||
|
||
build_flag_templates: | ||
- "--platform=linux/arm64" | ||
- "--pull" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.title={{.ProjectName}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
- "--label=org.opencontainers.image.licenses=AGPL-3.0-only" | ||
|
||
docker_manifests: | ||
- id: tag | ||
name_template: "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:{{ .Tag }}" | ||
image_templates: | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:{{ .Tag }}-amd64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:{{ .Tag }}-arm64" | ||
- id: major | ||
name_template: "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}" | ||
image_templates: | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}-amd64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}-arm64" | ||
- id: major-minor | ||
name_template: "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}" | ||
image_templates: | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}-amd64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}-arm64" | ||
- id: latest | ||
name_template: "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:latest" | ||
image_templates: | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:latest-amd64" | ||
- "{{ .Env.IMAGE_OWNER }}/{{ .ProjectName }}:latest-arm64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM debian:12.6-slim | ||
VOLUME /cache | ||
VOLUME /state | ||
RUN adduser -D -u 1000 -g 1000 -h /home/k6exec k6exec && \ | ||
mkdir -p /cache/k6exec /state/k6exec && \ | ||
chown -R 1000:1000 /cache /state | ||
ENV CGO_ENABLED=1 XDG_CACHE_HOME="/cache" XDG_STATE_HOME="/state" | ||
COPY k6exec /usr/bin/k6exec | ||
|
||
USER 1000 | ||
WORKDIR /home/k6exec | ||
ENTRYPOINT ["k6exec"] |
Oops, something went wrong.