From cb20f91223741e3d70f515ba3dd57aafecd5985c Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Sat, 13 Apr 2024 22:56:21 -0600 Subject: [PATCH] add CICD pipeline (untested) --- .drone.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 15 +++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..985dae1 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,44 @@ +kind: pipeline +name: default + +workspace: + base: /go + path: src/deadbeef.codes/steven/hyp + +steps: + +- name: create build environment + image: plugins/docker + settings: + repo: registry.deadbeef.codes/hyp-build + when: + target: + include: + - environment + +- name: build hyp linux-amd64 + image: registry.deadbeef.codes/hyp-build:latest + pull: always + environment: + GOOS: linux + GOARCH: amd64 + CGO_ENABLED: 0 + commands: + - mkdir /dist + - cd hyp + - go build . + - mv hyp /dist + - cd ../hypd/server + - go generate + - cd .. + - go build . + - mv hypd /dist + +- name: release + image: plugins/gitea-release + settings: + api_key: + from_secret: drone_token + base_url: https://deadbeef.codes + files: dist/* + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fbcc5fb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# Build environment container +# THIS CONTAINER IS NOT FOR RUNNING HYP, IT IS FOR BUILDING IT FROM SOURCE + +FROM debian:stable +LABEL maintainer="himself@stevenpolley.net" + +# Install build +RUN apt update -y && \ + apt upgrade -y && \ + apt install -y wget git clang linux-headers-amd64 libbpf-dev + +# Install golang +RUN wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz && \ + rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz && \ + rm -rf *.tar.gz \ No newline at end of file