From e4eed15074075f710b8e37896900fb99c57cab3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20Tr=E1=BB=8Dng=20H=E1=BA=A3i?= <41283691+hainenber@users.noreply.github.com> Date: Fri, 13 Oct 2023 22:26:24 +0700 Subject: [PATCH] feat(ci): switch to GH action for testing CI build image (#5342) --- .drone/drone.yml | 53 +------------------ .drone/pipelines/build_images.jsonnet | 38 ------------- .github/workflows/check-linux-build-image.yml | 26 +++++++++ .../workflows/check-windows-build-image.yml | 22 ++++++++ CHANGELOG.md | 2 +- 5 files changed, 50 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/check-linux-build-image.yml create mode 100644 .github/workflows/check-windows-build-image.yml diff --git a/.drone/drone.yml b/.drone/drone.yml index 0fefeb17a745..92336af4c4e5 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -1,30 +1,5 @@ --- kind: pipeline -name: Check Linux build image -platform: - arch: amd64 - os: linux -steps: -- commands: - - docker buildx build -t grafana/agent-build-image:latest ./build-image - image: docker - name: Build - volumes: - - name: docker - path: /var/run/docker.sock -trigger: - paths: - include: - - build-image/** - ref: - - refs/heads/main -type: docker -volumes: -- host: - path: /var/run/docker.sock - name: docker ---- -kind: pipeline name: Create Linux build image platform: arch: amd64 @@ -59,32 +34,6 @@ volumes: name: docker --- kind: pipeline -name: Check Windows build image -platform: - arch: amd64 - os: windows - version: "1809" -steps: -- commands: - - docker build -t grafana/agent-build-image:latest ./build-image/windows - image: docker:windowsservercore-1809 - name: Build - volumes: - - name: docker - path: //./pipe/docker_engine/ -trigger: - paths: - include: - - build-image/** - ref: - - refs/heads/main -type: docker -volumes: -- host: - path: //./pipe/docker_engine/ - name: docker ---- -kind: pipeline name: Create Windows build image platform: arch: amd64 @@ -1478,6 +1427,6 @@ kind: secret name: updater_private_key --- kind: signature -hmac: d9fd1e02c62a58f2f6ccd7c87108f53d0a701dd5d44e81366ff825edb9401ae6 +hmac: 372648213124cf1280ee4f0d402324dcc80b8a3304ae7a8e877bbe766ccb4074 ... diff --git a/.drone/pipelines/build_images.jsonnet b/.drone/pipelines/build_images.jsonnet index 16d09d58038b..6df4f8f6cd2c 100644 --- a/.drone/pipelines/build_images.jsonnet +++ b/.drone/pipelines/build_images.jsonnet @@ -17,25 +17,6 @@ local locals = { }; [ - pipelines.linux('Check Linux build image') { - trigger: locals.on_merge, - steps: [{ - name: 'Build', - image: 'docker', - volumes: [{ - name: 'docker', - path: '/var/run/docker.sock', - }], - commands: [ - 'docker buildx build -t grafana/agent-build-image:latest ./build-image', - ], - }], - volumes: [{ - name: 'docker', - host: { path: '/var/run/docker.sock' }, - }], - }, - pipelines.linux('Create Linux build image') { trigger: locals.on_build_image_tag, steps: [{ @@ -60,25 +41,6 @@ local locals = { }], }, - pipelines.windows('Check Windows build image') { - trigger: locals.on_merge, - steps: [{ - name: 'Build', - image: 'docker:windowsservercore-1809', - volumes: [{ - name: 'docker', - path: '//./pipe/docker_engine/', - }], - commands: [ - 'docker build -t grafana/agent-build-image:latest ./build-image/windows', - ], - }], - volumes: [{ - name: 'docker', - host: { path: '//./pipe/docker_engine/' }, - }], - }, - pipelines.windows('Create Windows build image') { trigger: locals.on_build_image_tag, steps: [{ diff --git a/.github/workflows/check-linux-build-image.yml b/.github/workflows/check-linux-build-image.yml new file mode 100644 index 000000000000..ca9201ede824 --- /dev/null +++ b/.github/workflows/check-linux-build-image.yml @@ -0,0 +1,26 @@ +name: Check Linux build image + +on: + pull_request: + paths: + - 'build-image/*' + +jobs: + check-linux-build-image: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Create test Linux build image + uses: docker/build-push-action@v5 + with: + context: ./build-image + push: false + tags: grafana/agent-build-image:latest \ No newline at end of file diff --git a/.github/workflows/check-windows-build-image.yml b/.github/workflows/check-windows-build-image.yml new file mode 100644 index 000000000000..33de47eb9828 --- /dev/null +++ b/.github/workflows/check-windows-build-image.yml @@ -0,0 +1,22 @@ +name: Check Windows build image + +on: + pull_request: + paths: + - 'build-image/windows/**' + +jobs: + check-windows-build-image: + runs-on: windows-2019 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Create test Windows build image + uses: mr-smithers-excellent/docker-build-push@v6 + with: + image: grafana/agent-build-image + tags: latest + registry: docker.io + pushImage: false + dockerfile: ./build-image/windows/Dockerfile \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 60d0f8c46690..8dbc9450113b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -191,7 +191,7 @@ v0.37.0 (2023-10-10) - Update Prometheus dependency to v2.46.0. (@tpaschalis) -- The `client_secret` config argument in the `otelcol.auth.oauth2` component is +- The `client_secret` config argument in the `otelcol.auth.oauth2` component is now of type `secret` instead of type `string`. (@ptodev) ### Bugfixes