feat: Add scp plugin build

This commit is contained in:
Andreas Mieke 2023-12-29 11:33:01 +01:00
parent 574418e870
commit 194ef1634c
3 changed files with 20 additions and 0 deletions

9
.woodpecker.yml Normal file
View file

@ -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

5
Dockerfile Normal file
View file

@ -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

6
plugin.sh Normal file
View file

@ -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}