From e391f6873033add3f1ff97b3ee6b2b1150108e7f Mon Sep 17 00:00:00 2001 From: surtur Date: Thu, 14 Jan 2021 01:36:16 +0100 Subject: [PATCH] feat: refactor .drone.yml * syntax as per https://github.com/drone/drone/blob/master/.drone.yml * fixed wrong yaml indentation that drone had to chew on... * added 'type: docker' and 'os: linux' to every pipeline where relevant --- .drone.yml | 122 +++++++++++++++++++++++++++-------------------------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/.drone.yml b/.drone.yml index cf5fef7..9030f57 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,8 +1,10 @@ --- kind: pipeline +type: docker name: dockerhub-build-trigger platform: + os: linux arch: amd64 clone: @@ -16,20 +18,21 @@ steps: ENDPOINT: from_secret: dockerhub_endpoint commands: - - apk add --no-cache curl - - curl -sO https://git.dotya.ml/wanderer/docker-fedora-hugo/raw/branch/master/curl.it - - bash ./curl.it $ENDPOINT - + - apk add --no-cache curl + - curl -sO https://git.dotya.ml/wanderer/docker-fedora-hugo/raw/branch/master/curl.it + - bash ./curl.it $ENDPOINT --- kind: pipeline +type: docker name: kaniko-build platform: + os: linux arch: amd64 depends_on: - - dockerhub-build-trigger +- dockerhub-build-trigger steps: - name: build @@ -39,9 +42,9 @@ steps: dockerfile: Dockerfile context: . - --- kind: pipeline +type: docker name: notifications platform: @@ -51,42 +54,43 @@ platform: clone: disable: true +steps: +- name: discord + pull: if-not-exists + image: appleboy/drone-discord:latest + settings: + message: > + {{#success build.status}} + ✅ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded. + event: **`{{build.event}}`** + commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` + {{else}} + ❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed. + event: **`${DRONE_BUILD_EVENT}`** + commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` + ```{{commit.message}}``` + {{/success}} + webhook_id: + from_secret: discord_webhook_id + webhook_token: + from_secret: discord_webhook_token + trigger: branch: - - master + - master event: - - push - - tag + - push + - tag status: - - success - - failure + - success + - failure depends_on: - - kaniko-build - -steps: - - name: discord - pull: if-not-exists - image: appleboy/drone-discord:latest - settings: - message: > - {{#success build.status}} - ✅ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded. - event: **`{{build.event}}`** - commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` - {{else}} - ❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed. - event: **`${DRONE_BUILD_EVENT}`** - commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` - ```{{commit.message}}``` - {{/success}} - webhook_id: - from_secret: discord_webhook_id - webhook_token: - from_secret: discord_webhook_token +- kaniko-build --- kind: pipeline +type: docker name: notifications-cronbuild platform: @@ -96,36 +100,36 @@ platform: clone: disable: true +steps: +- name: discord + pull: always + image: appleboy/drone-discord:latest + settings: + message: > + {{#success build.status}} + ✅ [Nightly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded. + event: **`{{build.event}}`** + commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` + {{else}} + ❌ [Nightly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed. + event: **`${DRONE_BUILD_EVENT}`** + commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` + {{/success}} + webhook_id: + from_secret: discord_webhook_hourly_id + webhook_token: + from_secret: discord_webhook_hourly_token + trigger: branch: - - master + - master event: - - cron + - cron cron: - - nightly + - nightly status: - - success - - failure + - success + - failure depends_on: - - kaniko-build - -steps: - - name: discord - pull: always - image: appleboy/drone-discord:latest - settings: - message: > - {{#success build.status}} - ✅ [Nightly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded. - event: **`{{build.event}}`** - commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` - {{else}} - ❌ [Nightly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed. - event: **`${DRONE_BUILD_EVENT}`** - commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}` - {{/success}} - webhook_id: - from_secret: discord_webhook_hourly_id - webhook_token: - from_secret: discord_webhook_hourly_token +- kaniko-build