-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: jmeterd executor and slave (#4371)
* add jmeterd ci
- Loading branch information
Showing
7 changed files
with
404 additions
and
5 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 |
---|---|---|
|
@@ -191,6 +191,98 @@ jobs: | |
DOCKER_BUILDX_CACHE_FROM: "type=gha" | ||
DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" | ||
|
||
executor_jmeterd: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- uses: sigstore/[email protected] | ||
- uses: anchore/sbom-action/[email protected] | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Go Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Push README to Dockerhub | ||
uses: christian-korneck/update-container-description-action@v1 | ||
env: | ||
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }} | ||
with: | ||
destination_container_repo: "kubeshop/testkube-jmeterd-executor" | ||
provider: dockerhub | ||
short_description: 'Testkube jmeterd executor' | ||
readme_file: "./contrib/executor/jmeterd/README.md" | ||
|
||
- name: Release | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release -f goreleaser_files/.goreleaser-docker-build-executor-jmeterd.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} | ||
DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" | ||
DOCKER_BUILDX_CACHE_FROM: "type=gha" | ||
DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" | ||
|
||
jmeterd_slave: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Docker Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./contrib/executor/jmeterd/build/slaves/Dockerfile | ||
push: true | ||
tags: kubeshop/testkube-jmeterd-slave:${{ github.event.release.tag_name }},kubeshop/testkube-jmeterd-slave:latest | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
executor_maven: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
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
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
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
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
50 changes: 50 additions & 0 deletions
50
goreleaser_files/.goreleaser-docker-build-executor-jmeterd-commit-only.yml
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,50 @@ | ||
env: | ||
# Goreleaser always uses the docker buildx builder with name "default"; see | ||
# https://github.com/goreleaser/goreleaser/pull/3199 | ||
# To use a builder other than "default", set this variable. | ||
# Necessary for, e.g., GitHub actions cache integration. | ||
- DOCKER_BUILDX_BUILDER={{ if index .Env "DOCKER_BUILDX_BUILDER" }}{{ .Env.DOCKER_BUILDX_BUILDER }}{{ else }}default{{ end }} | ||
# Setup to enable Docker to use, e.g., the GitHub actions cache; see | ||
# https://docs.docker.com/build/building/cache/backends/ | ||
# https://github.com/moby/buildkit#export-cache | ||
- DOCKER_BUILDX_CACHE_FROM={{ if index .Env "DOCKER_BUILDX_CACHE_FROM" }}{{ .Env.DOCKER_BUILDX_CACHE_FROM }}{{ else }}type=registry{{ end }} | ||
- DOCKER_BUILDX_CACHE_TO={{ if index .Env "DOCKER_BUILDX_CACHE_TO" }}{{ .Env.DOCKER_BUILDX_CACHE_TO }}{{ else }}type=inline{{ end }} | ||
|
||
builds: | ||
- id: "linux" | ||
main: "./contrib/executor/jmeterd/cmd/agent" | ||
binary: "jmeterd" | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
mod_timestamp: "{{ .CommitTimestamp }}" | ||
dockers: | ||
- dockerfile: "./contrib/executor/jmeterd/build/agent/Dockerfile" | ||
use: buildx | ||
goos: linux | ||
goarch: amd64 | ||
image_templates: | ||
- "kubeshop/testkube-jmeterd-executor:{{ .ShortCommit }}" | ||
build_flag_templates: | ||
- "--platform=linux/amd64" | ||
- "--label=org.opencontainers.image.title={{ .ProjectName }}" | ||
- "--label=org.opencontainers.image.created={{ .Date}}" | ||
- "--label=org.opencontainers.image.revision={{ .FullCommit }}" | ||
- "--label=org.opencontainers.image.version={{ .Version }}" | ||
- "--builder={{ .Env.DOCKER_BUILDX_BUILDER }}" | ||
- "--cache-to={{ .Env.DOCKER_BUILDX_CACHE_TO }}" | ||
- "--cache-from={{ .Env.DOCKER_BUILDX_CACHE_FROM }}" | ||
extra_files: | ||
- ./contrib/executor/jmeterd/scripts/entrypoint.sh | ||
- ./contrib/executor/jmeterd/scripts/jmeter-master.sh | ||
|
||
|
||
release: | ||
disable: true | ||
|
||
snapshot: | ||
name_template: '{{ .ShortCommit }}' |
Oops, something went wrong.