Skip to content

Commit

Permalink
Replace drone by github actions for image publishing (grafana#1271)
Browse files Browse the repository at this point in the history
* Replace drone by github actions for image publishing

* retitle actions
  • Loading branch information
mariomac authored Oct 28, 2024
1 parent 931859b commit 83b0459
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 253 deletions.
85 changes: 0 additions & 85 deletions .drone/drone.jsonnet

This file was deleted.

109 changes: 0 additions & 109 deletions .drone/drone.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/publish_dockerhub_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# TODO: trigger only if testing or any other checks previously succeeded
name: Push to DockerHub (main)
on:
push:
branches:
- main

permissions:
contents: read
id-token: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- id: checkout
uses: actions/checkout@v4

- id: push-to-dockerhub
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main
with:
repository: grafana/beyla
context: .
# cache image layers from/to github actions internal cache, for faster building
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: |-
"linux/amd64"
"linux/arm64"
tags: |-
"main"
push: true
35 changes: 35 additions & 0 deletions .github/workflows/publish_dockerhub_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# TODO: trigger only if testing or any other checks previously succeeded
name: Push to DockerHub (release)
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: read
id-token: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- id: checkout
uses: actions/checkout@v4

- id: push-to-dockerhub
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main
with:
repository: grafana/beyla
context: .
# cache image layers from/to github actions internal cache, for faster building
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: |-
"linux/amd64"
"linux/arm64"
tags: |-
"type=semver,pattern={{major}}"
"type=semver,pattern={{major}}.{{minor}}"
"type=semver,pattern={{major}}.{{minor}}.{{patch}}"
push: true
9 changes: 0 additions & 9 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ jobs:
- uses: actions/checkout@v3
with:
lfs: true
# TODO:
# - name: Check Drone.yml is up-to-date
# uses: chrislennon/action-drone@v1
# with:
# version: 1.7.0
# - run: make check-drone-drift
# env:
# DRONE_SERVER: ${{ secrets.DRONE_SERVER }}
# DRONE_TOKEN: ${{ secrets.DRONE_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
17 changes: 2 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ MAIN_GO_FILE ?= cmd/$(CMD)/main.go
GOOS ?= linux
GOARCH ?= amd64

# DRONE_TAG is set from Drone. Required for building container images.
RELEASE_VERSION := $(if $(DRONE_TAG),$(DRONE_TAG),$(shell git describe --tags --always))
# RELEASE_VERSION will contain the tag name, or the branch name if current commit is not a tag
RELEASE_VERSION := $(shell git describe --all | cut -d/ -f2)
RELEASE_REVISION := $(shell git rev-parse --short HEAD )
BUILDINFO_PKG ?= github.com/grafana/beyla/pkg/buildinfo
TEST_OUTPUT ?= ./testoutput
Expand All @@ -25,7 +25,6 @@ GEN_IMG ?= ghcr.io/grafana/beyla-generator:main
COMPOSE_ARGS ?= -f test/integration/docker-compose.yml

OCI_BIN ?= docker
DRONE ?= drone

# BPF code generator dependencies
CLANG ?= clang
Expand Down Expand Up @@ -326,18 +325,6 @@ oats-test: oats-test-sql oats-test-redis oats-test-kafka
oats-test-debug: oats-prereq
cd test/oats/kafka && TESTCASE_BASE_PATH=./yaml TESTCASE_MANUAL_DEBUG=true TESTCASE_TIMEOUT=1h $(GINKGO) -v -r

.PHONY: drone
drone:
@echo "### Regenerating and signing .drone/drone.yml"
drone jsonnet --format --stream --source .drone/drone.jsonnet --target .drone/drone.yml
drone lint .drone/drone.yml
drone sign --save grafana/beyla .drone/drone.yml || echo "You must set DRONE_SERVER and DRONE_TOKEN. These values can be found on your [drone account](http://drone.grafana.net/account) page."

.PHONY: check-drone-drift
check-drone-drift:
@echo "### checking that Drone.yml is up-to-date"
./scripts/check-drone-drift.sh

.PHONY: update-licenses
update-licenses: prereqs
@echo "### Updating third_party_licenses.csv"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Open source zero-code automatic instrumentation with eBPF and OpenTelemetry.

[![Build Status](https://drone.grafana.net/api/badges/grafana/beyla/status.svg?ref=refs/heads/main)](https://drone.grafana.net/grafana/beyla)
![status badge](https://github.com/grafana/beyla/actions/workflows/publish_dockerhub.yml/badge.svg)

## Introduction

Expand Down
34 changes: 0 additions & 34 deletions scripts/check-drone-drift.sh

This file was deleted.

0 comments on commit 83b0459

Please sign in to comment.