From 25f678b65d7e98b871472a6ee8cfbcb68ff7d651 Mon Sep 17 00:00:00 2001 From: guangning Date: Tue, 27 Jun 2023 12:04:55 +0800 Subject: [PATCH 1/7] Support release filebeat --- .github/workflows/release.yml | 28 +++++++++++++++++++++++++++- filebeat/Dockerfile | 3 +++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 filebeat/Dockerfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8dd4c1eb8..d21027668 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,4 +28,30 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.BEAT_ACCESS_TOKEN }} - GOPATH: /home/runner/work/pulsar-beat-output/pulsar-beat-output/go \ No newline at end of file + GOPATH: /home/runner/work/pulsar-beat-output/pulsar-beat-output/go + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Docker meta for filebeat + id: docker_meta_filebeat + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: | + streamnative/filebeat + tag-sha: true + + - name: Build and push beat image + uses: docker/build-push-action@v2 + with: + context: . + file: ./filebeat/Dockerfile + push: true + tags: ${{ steps.docker_meta_filebeat.outputs.tags }} + labels: ${{ steps.docker_meta_filebeat.outputs.labels }} \ No newline at end of file diff --git a/filebeat/Dockerfile b/filebeat/Dockerfile new file mode 100644 index 000000000..07c8e4d4d --- /dev/null +++ b/filebeat/Dockerfile @@ -0,0 +1,3 @@ +FROM elastic/filebeat:7.17.5 + +COPY --from=build-env /go/bin/filebeat /usr/share/filebeat/ \ No newline at end of file From e6fbbe20fb2fa324e86197335c84bb309e5c2502 Mon Sep 17 00:00:00 2001 From: guangning Date: Tue, 27 Jun 2023 12:07:13 +0800 Subject: [PATCH 2/7] Debug docker release --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d21027668..6f27c9032 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,6 +47,9 @@ jobs: streamnative/filebeat tag-sha: true + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Build and push beat image uses: docker/build-push-action@v2 with: From a5b6cb6ad9346cd0517956d37b3d22f208fd7514 Mon Sep 17 00:00:00 2001 From: guangning Date: Tue, 27 Jun 2023 12:10:07 +0800 Subject: [PATCH 3/7] Fixed release file --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f27c9032..5d38494cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,12 +40,12 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Docker meta for filebeat - id: docker_meta_filebeat - uses: crazy-max/ghaction-docker-meta@v1 - with: - images: | - streamnative/filebeat - tag-sha: true + id: docker_meta_filebeat + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: | + streamnative/filebeat + tag-sha: true - name: Setup tmate session uses: mxschmitt/action-tmate@v3 From 4b4a407e188f50a459e94d9fe2137d3cc46deb0e Mon Sep 17 00:00:00 2001 From: guangning Date: Tue, 27 Jun 2023 12:11:20 +0800 Subject: [PATCH 4/7] Fixed release --- .github/workflows/release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d38494cf..3f7c819fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,10 +51,10 @@ jobs: uses: mxschmitt/action-tmate@v3 - name: Build and push beat image - uses: docker/build-push-action@v2 - with: - context: . - file: ./filebeat/Dockerfile - push: true - tags: ${{ steps.docker_meta_filebeat.outputs.tags }} - labels: ${{ steps.docker_meta_filebeat.outputs.labels }} \ No newline at end of file + uses: docker/build-push-action@v2 + with: + context: . + file: ./filebeat/Dockerfile + push: true + tags: ${{ steps.docker_meta_filebeat.outputs.tags }} + labels: ${{ steps.docker_meta_filebeat.outputs.labels }} \ No newline at end of file From a1ef28373df691e2270c3537a02ac770d1ff1037 Mon Sep 17 00:00:00 2001 From: guangning Date: Tue, 27 Jun 2023 13:17:12 +0800 Subject: [PATCH 5/7] Fixed dockerfile --- .github/workflows/release.yml | 2 +- filebeat/Dockerfile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f7c819fb..7a856986c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ env: jobs: goreleaser: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Set up Go uses: actions/setup-go@v2 diff --git a/filebeat/Dockerfile b/filebeat/Dockerfile index 07c8e4d4d..ff251fe89 100644 --- a/filebeat/Dockerfile +++ b/filebeat/Dockerfile @@ -1,3 +1,4 @@ FROM elastic/filebeat:7.17.5 -COPY --from=build-env /go/bin/filebeat /usr/share/filebeat/ \ No newline at end of file +USER root +COPY dist/filebeat_linux_amd64_v1/beat /usr/share/filebeat \ No newline at end of file From c0249007e3555864df0b2687c8975ec2005dd80d Mon Sep 17 00:00:00 2001 From: guangning Date: Tue, 27 Jun 2023 17:16:53 +0800 Subject: [PATCH 6/7] Fixed github action --- .github/workflows/release.yml | 4 ++-- filebeat/Dockerfile | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a856986c..64a1e4f7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,8 +47,8 @@ jobs: streamnative/filebeat tag-sha: true - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 - name: Build and push beat image uses: docker/build-push-action@v2 diff --git a/filebeat/Dockerfile b/filebeat/Dockerfile index ff251fe89..6ba628299 100644 --- a/filebeat/Dockerfile +++ b/filebeat/Dockerfile @@ -1,4 +1,3 @@ FROM elastic/filebeat:7.17.5 -USER root -COPY dist/filebeat_linux_amd64_v1/beat /usr/share/filebeat \ No newline at end of file +COPY dist/filebeat_linux_amd64_v1/beat /usr/share/filebeat/filebeat \ No newline at end of file From b54045c87cb4c68c681f0c868ee56f68515bc336 Mon Sep 17 00:00:00 2001 From: guangning Date: Sun, 2 Jul 2023 19:37:21 +0800 Subject: [PATCH 7/7] Update action script --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64a1e4f7d..7a856986c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,8 +47,8 @@ jobs: streamnative/filebeat tag-sha: true -# - name: Setup tmate session -# uses: mxschmitt/action-tmate@v3 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - name: Build and push beat image uses: docker/build-push-action@v2