From fc7e412027e5f285a294b2d1ae9d320f2f687252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20H=C3=BCttemann?= Date: Thu, 20 Jun 2024 16:39:03 +0200 Subject: [PATCH] WIP --- .woodpecker.yaml => .woodpecker/.build.yaml | 8 ++- .woodpecker/.test.yaml | 56 +++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) rename .woodpecker.yaml => .woodpecker/.build.yaml (86%) create mode 100644 .woodpecker/.test.yaml diff --git a/.woodpecker.yaml b/.woodpecker/.build.yaml similarity index 86% rename from .woodpecker.yaml rename to .woodpecker/.build.yaml index ffb8897..13a3abc 100644 --- a/.woodpecker.yaml +++ b/.woodpecker/.build.yaml @@ -12,7 +12,9 @@ steps: password: from_secret: gitea_token repo: git.verdigado.com/${CI_REPO,,} - tag: 'latest' + tags: + - 'latest' + - ${CI_COMMIT_SHA} build-branch: when: @@ -28,4 +30,6 @@ steps: password: from_secret: gitea_token repo: git.verdigado.com/${CI_REPO,,} - tag: ${CI_COMMIT_BRANCH} + tags: + - ${CI_COMMIT_BRANCH} + - ${CI_COMMIT_SHA} diff --git a/.woodpecker/.test.yaml b/.woodpecker/.test.yaml new file mode 100644 index 0000000..e4b80d1 --- /dev/null +++ b/.woodpecker/.test.yaml @@ -0,0 +1,56 @@ +skip_clone: true +when: + - event: push +depends_on: + - build +variables: + - &image 'git.verdigado.com/verdigado-images/container-pre-commit:${CI_COMMIT_SHA}' +steps: + await-image: + image: alpine + environment: + IMAGE: *image + commands: + - apk add --update --no-cache img + - 'while !(( img pull $IMAGE 2>&1 | grep -q "Error: failed to unmount" )) ; do echo "Awaiting image $IMAGE..."; sleep 3; done' + - echo 'found.' + + salt clone: + image: woodpeckerci/plugin-git + settings: + remote: https://git.verdigado.com/verdigado-Privileged/Salt.git + path: salt + sha: '' + ref: refs/heads/master + branch: master + + salt pre-commit: + image: *image + depends_on: + - await-image + - salt clone + environment: + - SKIP=no-commit-to-branch # Ignore "don't commit to protected branch" check + commands: + - cd salt + - pre-commit run --all-files + + rocketchat2matrix clone: + image: woodpeckerci/plugin-git + settings: + remote: https://git.verdigado.com/NB-Public/rocketchat2matrix.git + path: rocketchat2matrix + sha: '' + ref: refs/heads/main + branch: master + + rocketchat2matrix pre-commit: + image: *image + depends_on: + - await-image + - rocketchat2matrix clone + environment: + - SKIP=no-commit-to-branch # Ignore "don't commit to protected branch" check + commands: + - cd rocketchat2matrix + - pre-commit run --all-files