Import OSCW runner
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
2022-07-24 22:38:42 +02:00
commit b9cfdb1fd5
5 changed files with 98 additions and 0 deletions

21
files/entrypoint.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -e
# no arguments passed
# or first arg is `-f` or `--some-option`
if [ "$#" -eq 0 -o "${1#-}" != "$1" ]; then
# add our default arguments
set -- dockerd \
--host=unix:///var/run/docker.sock \
--host=tcp://0.0.0.0:2375 \
--storage-driver=vfs \
"$@"
fi
if [ "$1" = 'dockerd' ]; then
# if we're running Docker, let's pipe through dind
# (and we'll run dind explicitly with "sh" since its shebang is /bin/bash)
set -- sh "$(which dind)" "$@"
fi
exec "$@"

22
files/github_publish Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
GITHUB_USERNAME="${1}"
GITHUB_TOKEN="${2}"
ASSET_NAME="${3}"
echo "Creating new GitHub release '${CI_COMMIT_TAG}'"
RESULT=$(curl --user "${GITHUB_USERNAME}:${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${CI_REPO}/releases -d \
"{
\"tag_name\": \"${CI_COMMIT_TAG}\",
\"target_commitish\": \"${CI_COMMIT_SHA}\",
\"name\": \"${CI_COMMIT_TAG}\",
\"draft\": false,
\"prerelease\": false
}")
echo "Create release result: ${RESULT}"
RELEASE_ID=$(echo "${RESULT}" | python -c 'import json,sys;print(json.load(sys.stdin)["id"])')
echo "Publishing artifact: ${ASSET_NAME}"
curl --user "${GITHUB_USERNAME}:${GITHUB_TOKEN}" -X POST https://uploads.github.com/repos/${CI_REPO}/releases/${RELEASE_ID}/assets?name=${ASSET_NAME} \
--header 'Content-Type: text/javascript ' --upload-file ${ASSET_NAME}