commit 017cf5f58a6f92594005a5827c61e11a93c73be5 Author: Tobias Manske Date: Sat Oct 29 19:32:44 2022 +0200 Init diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..a43e727 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,87 @@ +--- +kind: pipeline +type: docker +name: Build CoreOS Installer + +trigger: + branch: + - main + event: + include: + - push + - custom + - cron + +steps: + - name: Pull Cache + image: plugins/s3-cache + settings: + pull: true + endpoint: https://s3.tobiasmanske.de + root: cache + access_key: + from_secret: minio_access_key + secret_key: + from_secret: minio_secret_key + restore: true + + - name: Build Binary + depends_on: + - Pull Cache + image: rust:1-bullseye # Same OS that runs the hetzner recovery + pull: always + environment: + CARGO_HOME: ./.cargo + commands: + - apt-get update + - apt-get install -y build-essential libssl-dev libzstd-dev pkg-config + - cargo install --bin=coreos-installer --target=x86_64-unknown-linux-gnu coreos-installer + + - name: Upload Binary + depends_on: + - Build Binary + image: plugins/s3 + settings: + endpoint: https://s3.tobiasmanske.de + path_style: true + bucket: public + access_key: + from_secret: minio_access_key + secret_key: + from_secret: minio_secret_key + source: .cargo/bin/coreos-installer + strip_prefix: .cargo/bin + target: /${DRONE_REPO}/${DRONE_REPO_BRANCH} + + - name: Upload Artifact to Gitea + depends_on: + - Build Binary + image: plugins/gitea-release + settings: + api_key: + from_secret: gitea_api_token + checksum: sha256 + base_url: https://git.tobiasmanske.de + files: .cargo/bin/coreos-installer + when: + event: + - tag + + - name: Push Cache + depends_on: + - Build Binary + image: plugins/s3-cache + settings: + pull: true + endpoint: https://s3.tobiasmanske.de + root: cache + access_key: + from_secret: minio_access_key + secret_key: + from_secret: minio_secret_key + rebuild: true + mount: + - .cargo + +image_pull_secrets: + - registry