From 08e19dbdfcc8032cec723f4a9bfe26f179f6fa4c Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 13:23:17 +0000 Subject: [PATCH 01/12] Initial configuration of GoReleaser --- .gitignore | 2 ++ .goreleaser.yaml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 6 +++++ 3 files changed, 73 insertions(+) create mode 100644 .goreleaser.yaml create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore index 704c865..b1fb754 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ ripley + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..5dde845 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,65 @@ +release: + mode: replace + +before: + hooks: + - go mod tidy +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - darwin +archives: + - replacements: + darwin: Darwin + linux: Linux + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' +brews: + - + name: ripley + tap: + owner: loveholidays + name: homebrew-tap + commit_author: + name: loveholidays + email: oss@loveholidays.com + folder: Formula + homepage: "https://github.com/loveholidays/ripley" + description: "Replays HTTP traffic at multiples of the original rate" + install: | + bin.install "ripley" + license: "GPL-3.0" +dockers: + - image_templates: ["loveholidays/{{ .ProjectName }}:{{ .Version }}-amd64"] + goarch: amd64 + dockerfile: Dockerfile + build_flag_templates: + - --platform=linux/amd64 + - --label=org.opencontainers.image.title={{ .ProjectName }} + - --label=org.opencontainers.image.description={{ .ProjectName }} + - --label=org.opencontainers.image.source=https://github.com/loveholidays/ripley + - --label=org.opencontainers.image.version={{ .Version }} + - --label=org.opencontainers.image.revision={{ .FullCommit }} + - --label=org.opencontainers.image.licenses=GPL-3.0 + - image_templates: ["loveholidays/{{ .ProjectName }}:{{ .Version }}-arm64v8"] + goarch: arm64 + dockerfile: Dockerfile + build_flag_templates: + - --platform=linux/arm64/v8 + - --label=org.opencontainers.image.title={{ .ProjectName }} + - --label=org.opencontainers.image.description={{ .ProjectName }} + - --label=org.opencontainers.image.source=https://github.com/loveholidays/ripley + - --label=org.opencontainers.image.version={{ .Version }} + - --label=org.opencontainers.image.revision={{ .FullCommit }} + - --label=org.opencontainers.image.licenses=GPL-3.0 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3d784ad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +# Start fresh from a smaller image +FROM alpine +RUN apk add ca-certificates + +COPY ripley /usr/bin/ripley +ENTRYPOINT ["/usr/bin/ripley"] \ No newline at end of file From 93daf4ec7340ad6b69eb8330d6770d2acafa4e05 Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 14:12:31 +0000 Subject: [PATCH 02/12] Enabling GitHub Actions for GoReleaser --- .github/goreleaser.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/goreleaser.yaml diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml new file mode 100644 index 0000000..d16701a --- /dev/null +++ b/.github/goreleaser.yaml @@ -0,0 +1,29 @@ +name: goreleaser + +on: +# pull_request: + push: + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 324512630a5460c608b7211f2dd4c2bdf1c5e874 Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 14:16:28 +0000 Subject: [PATCH 03/12] Moving GitHub Actions into workflows --- .github/{ => workflows}/goreleaser.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/goreleaser.yaml (100%) diff --git a/.github/goreleaser.yaml b/.github/workflows/goreleaser.yaml similarity index 100% rename from .github/goreleaser.yaml rename to .github/workflows/goreleaser.yaml From b3ba86167dddbe8d75f22571dee098a1bff15e85 Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 14:17:15 +0000 Subject: [PATCH 04/12] Bumping Go version to 1.17 --- .github/workflows/goreleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index d16701a..e73942e 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -17,7 +17,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.17 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 From cb2d1727fb749f83614bf3ca257eda0272565265 Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 14:29:28 +0000 Subject: [PATCH 05/12] Split ARM Dockerfile --- .goreleaser.yaml | 2 +- Dockerfile | 2 +- Dockerfile.arm64v8 | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 Dockerfile.arm64v8 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5dde845..bafd472 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -54,7 +54,7 @@ dockers: - --label=org.opencontainers.image.licenses=GPL-3.0 - image_templates: ["loveholidays/{{ .ProjectName }}:{{ .Version }}-arm64v8"] goarch: arm64 - dockerfile: Dockerfile + dockerfile: Dockerfile.arm64v8 build_flag_templates: - --platform=linux/arm64/v8 - --label=org.opencontainers.image.title={{ .ProjectName }} diff --git a/Dockerfile b/Dockerfile index 3d784ad..7f10616 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Start fresh from a smaller image -FROM alpine +FROM alpine:3.15.0 RUN apk add ca-certificates COPY ripley /usr/bin/ripley diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 new file mode 100644 index 0000000..0b08430 --- /dev/null +++ b/Dockerfile.arm64v8 @@ -0,0 +1,6 @@ +# Start fresh from a smaller image +FROM arm64v8/alpine:3.15.0 +RUN apk add ca-certificates + +COPY ripley /usr/bin/ripley +ENTRYPOINT ["/usr/bin/ripley"] \ No newline at end of file From 20dba15e77fc7949759b9b28d047d1aec60f80e4 Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 14:32:18 +0000 Subject: [PATCH 06/12] Disable ARM64 docker builds --- .goreleaser.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index bafd472..80c49ae 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -52,14 +52,14 @@ dockers: - --label=org.opencontainers.image.version={{ .Version }} - --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.licenses=GPL-3.0 - - image_templates: ["loveholidays/{{ .ProjectName }}:{{ .Version }}-arm64v8"] - goarch: arm64 - dockerfile: Dockerfile.arm64v8 - build_flag_templates: - - --platform=linux/arm64/v8 - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description={{ .ProjectName }} - - --label=org.opencontainers.image.source=https://github.com/loveholidays/ripley - - --label=org.opencontainers.image.version={{ .Version }} - - --label=org.opencontainers.image.revision={{ .FullCommit }} - - --label=org.opencontainers.image.licenses=GPL-3.0 \ No newline at end of file +# - image_templates: ["loveholidays/{{ .ProjectName }}:{{ .Version }}-arm64v8"] +# goarch: arm64 +# dockerfile: Dockerfile.arm64v8 +# build_flag_templates: +# - --platform=linux/arm64/v8 +# - --label=org.opencontainers.image.title={{ .ProjectName }} +# - --label=org.opencontainers.image.description={{ .ProjectName }} +# - --label=org.opencontainers.image.source=https://github.com/loveholidays/ripley +# - --label=org.opencontainers.image.version={{ .Version }} +# - --label=org.opencontainers.image.revision={{ .FullCommit }} +# - --label=org.opencontainers.image.licenses=GPL-3.0 \ No newline at end of file From 60d3603c02740ca1e891821316032f5414a85dbc Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 15:09:18 +0000 Subject: [PATCH 07/12] Testing Github Actions release --- .github/workflows/goreleaser.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index e73942e..d8c3b19 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -1,8 +1,9 @@ name: goreleaser on: -# pull_request: push: +# tags: +# - '*' jobs: goreleaser: @@ -26,4 +27,4 @@ jobs: version: latest args: release --rm-dist env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.TOKEN_GORELEASER }} \ No newline at end of file From 281948c71395df82923f561880b1e5bb72464b8b Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 15:15:09 +0000 Subject: [PATCH 08/12] Perform release --- .github/workflows/goreleaser.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index d8c3b19..3b96264 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -2,8 +2,8 @@ name: goreleaser on: push: -# tags: -# - '*' + tags: + - '*' jobs: goreleaser: From 0b2b1fa07b41e6305f53b52f22dac99f49075bfc Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 15:23:42 +0000 Subject: [PATCH 09/12] logging into Docker Hub --- .github/workflows/goreleaser.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index 3b96264..314397a 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -9,6 +9,11 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Checkout uses: actions/checkout@v2 From e5e15f5758f498fd1f8c2ee678615b6f71090f9a Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 4 Jan 2022 15:51:36 +0000 Subject: [PATCH 10/12] Remove ARM64 docker image building/publishing --- .goreleaser.yaml | 13 +------------ Dockerfile.arm64v8 | 6 ------ 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 Dockerfile.arm64v8 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 80c49ae..75cd0b6 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -51,15 +51,4 @@ dockers: - --label=org.opencontainers.image.source=https://github.com/loveholidays/ripley - --label=org.opencontainers.image.version={{ .Version }} - --label=org.opencontainers.image.revision={{ .FullCommit }} - - --label=org.opencontainers.image.licenses=GPL-3.0 -# - image_templates: ["loveholidays/{{ .ProjectName }}:{{ .Version }}-arm64v8"] -# goarch: arm64 -# dockerfile: Dockerfile.arm64v8 -# build_flag_templates: -# - --platform=linux/arm64/v8 -# - --label=org.opencontainers.image.title={{ .ProjectName }} -# - --label=org.opencontainers.image.description={{ .ProjectName }} -# - --label=org.opencontainers.image.source=https://github.com/loveholidays/ripley -# - --label=org.opencontainers.image.version={{ .Version }} -# - --label=org.opencontainers.image.revision={{ .FullCommit }} -# - --label=org.opencontainers.image.licenses=GPL-3.0 \ No newline at end of file + - --label=org.opencontainers.image.licenses=GPL-3.0 \ No newline at end of file diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 deleted file mode 100644 index 0b08430..0000000 --- a/Dockerfile.arm64v8 +++ /dev/null @@ -1,6 +0,0 @@ -# Start fresh from a smaller image -FROM arm64v8/alpine:3.15.0 -RUN apk add ca-certificates - -COPY ripley /usr/bin/ripley -ENTRYPOINT ["/usr/bin/ripley"] \ No newline at end of file From cb2ab614180dfbab36e6985eddc77905994506b8 Mon Sep 17 00:00:00 2001 From: Dmitri Lerko Date: Tue, 18 Jan 2022 16:05:30 +0000 Subject: [PATCH 11/12] Adding installation instruction and build for latest tag --- .gitignore | 2 +- .goreleaser.yaml | 11 +++++++++++ README.md | 17 ++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b1fb754..8c870e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ ripley - +.idea/ dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 75cd0b6..fbcb2ad 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -42,6 +42,17 @@ brews: license: "GPL-3.0" dockers: - image_templates: ["loveholidays/{{ .ProjectName }}:{{ .Version }}-amd64"] + goarch: amd64 + dockerfile: Dockerfile + build_flag_templates: + - --platform=linux/amd64 + - --label=org.opencontainers.image.title={{ .ProjectName }} + - --label=org.opencontainers.image.description={{ .ProjectName }} + - --label=org.opencontainers.image.source=https://github.com/loveholidays/ripley + - --label=org.opencontainers.image.version={{ .Version }} + - --label=org.opencontainers.image.revision={{ .FullCommit }} + - --label=org.opencontainers.image.licenses=GPL-3.0 + - image_templates: [ "loveholidays/{{ .ProjectName }}:latest" ] goarch: amd64 dockerfile: Dockerfile build_flag_templates: diff --git a/README.md b/README.md index 393d034..a26192b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,22 @@ Ripley replays HTTP traffic at multiples of the original rate. It simulates traf ## Quickstart -Clone and build ripley +### Pre-build: + +MasOS: +```bash +brew install loveholidays/tap/ripley +``` +Docker: +```bash +docker pull loveholidays/ripley +``` +Linux: + +Grab a latest OS/Arch compatible binary from our [Releases](https://github.com/loveholidays/ripley/releases) page. + + +### From source: ```bash git clone git@github.com:loveholidays/ripley.git From a0cea739e2ebd99fc75027effa4f3353027d8640 Mon Sep 17 00:00:00 2001 From: George Malamidis Date: Tue, 18 Jan 2022 18:15:21 +0000 Subject: [PATCH 12/12] Installation instruction refinements --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a26192b..cb090f2 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ Ripley replays HTTP traffic at multiples of the original rate. It simulates traffic ramp up or down by specifying rate phases for each run. For example, you can replay HTTP requests at twice the original rate for ten minutes, then three times the original rate for five minutes, then ten times the original rate for an hour and so on. Ripley's original use case is load testing by replaying HTTP access logs from production applications. -## Quickstart +## Install -### Pre-build: +### Pre-built MasOS: ```bash @@ -16,10 +16,10 @@ docker pull loveholidays/ripley ``` Linux: -Grab a latest OS/Arch compatible binary from our [Releases](https://github.com/loveholidays/ripley/releases) page. +Grab the latest OS/Arch compatible binary from our [Releases](https://github.com/loveholidays/ripley/releases) page. -### From source: +### From source ```bash git clone git@github.com:loveholidays/ripley.git @@ -27,6 +27,7 @@ cd ripley go build -o ripley main.go ``` +#### Quickstart from source Run a web server to replay traffic against ```bash