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