From 0bb74cc744d1f4ecb4ccfae4bcfddf4e95dce2ae Mon Sep 17 00:00:00 2001 From: Paulin Todev Date: Thu, 30 Jan 2025 09:24:37 +0000 Subject: [PATCH] Run make drone. (#2557) This syncs the Drone pipelines with drone.jsonnet. --- .drone/drone.jsonnet | 1 - .drone/drone.yml | 13 +--- .drone/pipelines/build_images.jsonnet | 91 --------------------------- 3 files changed, 2 insertions(+), 103 deletions(-) delete mode 100644 .drone/pipelines/build_images.jsonnet diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index d718f9c0ff..27a6579114 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -1,6 +1,5 @@ local pipelines = import './pipelines.jsonnet'; -(import 'pipelines/build_images.jsonnet') + (import 'pipelines/test.jsonnet') + (import 'pipelines/check_containers.jsonnet') + (import 'pipelines/crosscompile.jsonnet') + diff --git a/.drone/drone.yml b/.drone/drone.yml index 5f3b82d77b..4682db9e9c 100644 --- a/.drone/drone.yml +++ b/.drone/drone.yml @@ -1,3 +1,4 @@ +--- kind: pipeline name: Lint platform: @@ -119,7 +120,6 @@ volumes: path: //./pipe/docker_engine/ name: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (Linux amd64) platform: @@ -137,7 +137,6 @@ trigger: - pull_request type: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (Linux arm64) platform: @@ -155,7 +154,6 @@ trigger: - pull_request type: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (Linux ppc64le) platform: @@ -173,7 +171,6 @@ trigger: - pull_request type: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (Linux s390x) platform: @@ -191,7 +188,6 @@ trigger: - pull_request type: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (macOS Intel) platform: @@ -208,7 +204,6 @@ trigger: - pull_request type: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (macOS Apple Silicon) platform: @@ -225,7 +220,6 @@ trigger: - pull_request type: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (Windows amd64) platform: @@ -242,7 +236,6 @@ trigger: - pull_request type: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (FreeBSD amd64) platform: @@ -259,7 +252,6 @@ trigger: - pull_request type: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (Linux amd64 boringcrypto) platform: @@ -277,7 +269,6 @@ trigger: - pull_request type: docker --- -# TODO: Remove this pipeline later kind: pipeline name: Build alloy (Linux arm64 boringcrypto) platform: @@ -743,6 +734,6 @@ kind: secret name: updater_private_key --- kind: signature -hmac: 5c0ba3650cd2bbdccc1b19b96b07ac8f76d78b4dcd461dddc140857a86db1900 +hmac: cf3043f3104be4dd320c4cd79c5e80802dc3b03743852df4fd98ffd981ae146e ... diff --git a/.drone/pipelines/build_images.jsonnet b/.drone/pipelines/build_images.jsonnet deleted file mode 100644 index 9a2fb14175..0000000000 --- a/.drone/pipelines/build_images.jsonnet +++ /dev/null @@ -1,91 +0,0 @@ -local pipelines = import '../util/pipelines.jsonnet'; -local secrets = import '../util/secrets.jsonnet'; - -local locals = { - on_merge: { - ref: ['refs/heads/main'], - paths: { include: ['tools/build-image/**'] }, - }, - on_build_image_tag: { - event: ['tag'], - ref: ['refs/tags/build-image/v*'], - }, - docker_environment: { - DOCKER_LOGIN: secrets.docker_login.fromSecret, - DOCKER_PASSWORD: secrets.docker_password.fromSecret, - }, -}; - -[ - pipelines.linux('Create Linux build image') { - trigger: locals.on_build_image_tag, - steps: [{ - name: 'Build', - image: 'docker', - volumes: [{ - name: 'docker', - path: '/var/run/docker.sock', - }], - environment: locals.docker_environment, - commands: [ - 'export IMAGE_TAG=${DRONE_TAG##build-image/}', - 'docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD', - 'docker run --rm --privileged multiarch/qemu-user-static --reset -p yes', - 'docker buildx create --name multiarch --driver docker-container --use', - 'docker buildx build --build-arg="GO_RUNTIME=golang:1.23.5-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:$IMAGE_TAG ./tools/build-image', - ], - }], - volumes: [{ - name: 'docker', - host: { path: '/var/run/docker.sock' }, - }], - }, - pipelines.linux('Create Linux build image for boringcrypto') { - trigger: locals.on_build_image_tag, - steps: [{ - name: 'Build', - image: 'docker', - volumes: [{ - name: 'docker', - path: '/var/run/docker.sock', - }], - environment: locals.docker_environment, - commands: [ - 'export IMAGE_TAG=${DRONE_TAG##build-image/}-boringcrypto', - 'docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD', - 'docker run --rm --privileged multiarch/qemu-user-static --reset -p yes', - 'docker buildx create --name multiarch --driver docker-container --use', - 'docker buildx build --build-arg="GO_RUNTIME=mcr.microsoft.com/oss/go/microsoft/golang:1.23.5-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:$IMAGE_TAG ./tools/build-image', - ], - }], - volumes: [{ - name: 'docker', - host: { path: '/var/run/docker.sock' }, - }], - }, - - pipelines.windows('Create Windows build image') { - trigger: locals.on_build_image_tag, - steps: [{ - name: 'Build', - image: 'docker:windowsservercore-1809', - volumes: [{ - name: 'docker', - path: '//./pipe/docker_engine/', - }], - environment: locals.docker_environment, - commands: [ - // NOTE(rfratto): the variable syntax is parsed ahead of time by Drone, - // and not by Windows (where the syntax obviously wouldn't work). - '$IMAGE_TAG="${DRONE_TAG##build-image/}-windows"', - 'docker login -u $Env:DOCKER_LOGIN -p $Env:DOCKER_PASSWORD', - 'docker build -t grafana/alloy-build-image:$IMAGE_TAG ./tools/build-image/windows', - 'docker push grafana/alloy-build-image:$IMAGE_TAG', - ], - }], - volumes: [{ - name: 'docker', - host: { path: '//./pipe/docker_engine/' }, - }], - }, -]