From 194ef1634c0e4b5d86e659def60dfdf0a3e0faa6 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 11:33:01 +0100 Subject: [PATCH 01/12] feat: Add scp plugin build --- .woodpecker.yml | 9 +++++++++ Dockerfile | 5 +++++ plugin.sh | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100644 .woodpecker.yml create mode 100644 Dockerfile create mode 100644 plugin.sh diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..10c5395 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,9 @@ +publish: + image: woodpeckerci/plugin-docker-buildx + settings: + repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp + registry: git.merp.digital + tags: develop + username: ${CI_REPO_OWNER} + password: + from_secret: cb_token \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2ec0f19 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine +ADD plugin.sh /bin/ +RUN chmod +x /bin/plugin.sh +RUN apk -Uuv add openssh +ENTRYPOINT /bin/plugin.sh \ No newline at end of file diff --git a/plugin.sh b/plugin.sh new file mode 100644 index 0000000..d3b1b38 --- /dev/null +++ b/plugin.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +mkdir -p /root/.ssh +echo "${PLUGIN_SSH_KEY}" > "/root/.ssh/id_rsa" +echo "${PLUGIN_SSH_KNOWN_HOSTS}" > "/root/.ssh/known_hosts" +scp -B ${PLUGIN_EXTRA_FLAGS} ${PLUGIN_SOURCE} ${PLUGIN_DESTINATION} \ No newline at end of file From f7d976d1dc07e8c6d520651007ada73e0a25f242 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 11:39:15 +0100 Subject: [PATCH 02/12] ci: Fix missing steps --- .woodpecker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 10c5395..1417678 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,4 +1,5 @@ -publish: +steps: + publish: image: woodpeckerci/plugin-docker-buildx settings: repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp From 7972b5a12be91ac2efa3a72862485ced3e2507c6 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 11:50:38 +0100 Subject: [PATCH 03/12] ci: Add latest tag for tags --- .woodpecker.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1417678..a4b056b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,7 +4,21 @@ steps: settings: repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp registry: git.merp.digital - tags: develop + tags: ${CI_COMMIT_BRANCH} username: ${CI_REPO_OWNER} password: - from_secret: cb_token \ No newline at end of file + from_secret: cb_token + when: + - event: [push] + + publish: + image: woodpeckerci/plugin-docker-buildx + settings: + repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp + registry: git.merp.digital + tags: [latest, ${CI_COMMIT_TAG}] + username: ${CI_REPO_OWNER} + password: + from_secret: cb_token + when: + - event: [tag] \ No newline at end of file From 4f6bf577ac4eed567ad2f2a7995ccaba4a845df2 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 11:52:19 +0100 Subject: [PATCH 04/12] ci: Remove run condition for 'default' publish job --- .woodpecker.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index a4b056b..a472409 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -8,10 +8,8 @@ steps: username: ${CI_REPO_OWNER} password: from_secret: cb_token - when: - - event: [push] - publish: + publish-release: image: woodpeckerci/plugin-docker-buildx settings: repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp From 3d31e6e15e0d55d2d035a1c71947411e6633487c Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 11:54:47 +0100 Subject: [PATCH 05/12] ci: Fix array --- .woodpecker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index a472409..8439af1 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -14,7 +14,9 @@ steps: settings: repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp registry: git.merp.digital - tags: [latest, ${CI_COMMIT_TAG}] + tags: + - latest + - ${CI_COMMIT_TAG} username: ${CI_REPO_OWNER} password: from_secret: cb_token From 0603f715b6c9817097c5b7102638b3491ac0a893 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 11:55:21 +0100 Subject: [PATCH 06/12] ci: Fix when event --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 8439af1..bf51e7a 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -21,4 +21,4 @@ steps: password: from_secret: cb_token when: - - event: [tag] \ No newline at end of file + - event: tag \ No newline at end of file From 948a42a6f2786b175ca8bd2f01d90252a6bd80d4 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 11:56:12 +0100 Subject: [PATCH 07/12] ci: Fix identation --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index bf51e7a..e538ffa 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -20,5 +20,5 @@ steps: username: ${CI_REPO_OWNER} password: from_secret: cb_token - when: - - event: tag \ No newline at end of file + when: + - event: tag \ No newline at end of file From fb845b4135f7526dd9e4f0dbd11b1a9098cefdd6 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 11:58:05 +0100 Subject: [PATCH 08/12] ci: Add all the platforms --- .woodpecker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index e538ffa..6bc2a55 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -3,6 +3,7 @@ steps: image: woodpeckerci/plugin-docker-buildx settings: repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp + platforms: windows/amd64,darwin/amd64,darwin/arm64,freebsd/amd64,linux/amd64,linux/arm64/v8 registry: git.merp.digital tags: ${CI_COMMIT_BRANCH} username: ${CI_REPO_OWNER} @@ -13,6 +14,7 @@ steps: image: woodpeckerci/plugin-docker-buildx settings: repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp + platforms: windows/amd64,darwin/amd64,darwin/arm64,freebsd/amd64,linux/amd64,linux/arm64/v8 registry: git.merp.digital tags: - latest From a4df634f87c64065d2c30833cdd35fdbbb4f3496 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 12:01:16 +0100 Subject: [PATCH 09/12] ci: Remove platforms not supported by alpine --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 6bc2a55..83a12aa 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -3,7 +3,7 @@ steps: image: woodpeckerci/plugin-docker-buildx settings: repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp - platforms: windows/amd64,darwin/amd64,darwin/arm64,freebsd/amd64,linux/amd64,linux/arm64/v8 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x registry: git.merp.digital tags: ${CI_COMMIT_BRANCH} username: ${CI_REPO_OWNER} @@ -14,7 +14,7 @@ steps: image: woodpeckerci/plugin-docker-buildx settings: repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp - platforms: windows/amd64,darwin/amd64,darwin/arm64,freebsd/amd64,linux/amd64,linux/arm64/v8 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x registry: git.merp.digital tags: - latest From 8152b883db2aa422b8ba23ad2a24f5272e1a9c14 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 12:36:30 +0100 Subject: [PATCH 10/12] ci: Only publish on develop and for tags --- .woodpecker.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 83a12aa..d7f8e71 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,5 +1,13 @@ steps: - publish: + build: + image: woodpeckerci/plugin-docker-buildx + settings: + dry-run: true + repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x + registry: git.merp.digital + + publish-nightly: image: woodpeckerci/plugin-docker-buildx settings: repo: git.merp.digital/${CI_REPO_OWNER}/woodpecker-scp @@ -9,6 +17,8 @@ steps: username: ${CI_REPO_OWNER} password: from_secret: cb_token + when: + - branch: develop publish-release: image: woodpeckerci/plugin-docker-buildx From 55196da8411843096794e63711e8f6f4e2922267 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 12:37:05 +0100 Subject: [PATCH 11/12] ci: Fix identation again... --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index d7f8e71..a57b875 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -17,8 +17,8 @@ steps: username: ${CI_REPO_OWNER} password: from_secret: cb_token - when: - - branch: develop + when: + - branch: develop publish-release: image: woodpeckerci/plugin-docker-buildx From 641db218516309e0f746b9178012d901b63b78e1 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Fri, 29 Dec 2023 12:44:15 +0100 Subject: [PATCH 12/12] chore: Add LICENSE and .gitignore --- .gitignore | 18 ++++++++++++++++++ LICENSE.md | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..514c7a1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..dea9cc4 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2023 Andreas Mieke + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file