generated from Templates/Baseline
migrate content
This commit is contained in:
parent
bd4938c24c
commit
e055dce72a
82
.woodpecker/ci.yml
Normal file
82
.woodpecker/ci.yml
Normal file
@ -0,0 +1,82 @@
|
||||
when:
|
||||
- event: [pull_request, tag, cron]
|
||||
- event: push
|
||||
branch:
|
||||
- ${CI_REPO_DEFAULT_BRANCH}
|
||||
|
||||
variables:
|
||||
- &build_plugin 'woodpeckerci/plugin-docker-buildx:3.2.1'
|
||||
# deployment targets
|
||||
- &publish_repos 'ocram85/plugin-gitea-package,gitea.ocram85.com/plugins/gitea-package'
|
||||
# logins for deployment targets
|
||||
- publish_logins: &publish_logins
|
||||
# Default DockerHub login
|
||||
- registry: https://index.docker.io/v1/
|
||||
username:
|
||||
from_secret: docker_user
|
||||
password:
|
||||
from_secret: docker_passwd
|
||||
# Additional Quay.IO login
|
||||
- registry: https://gitea.ocram85.com
|
||||
username:
|
||||
from_secret: gitea_user
|
||||
password:
|
||||
from_secret: gitea_passwd
|
||||
|
||||
steps:
|
||||
test:
|
||||
image: *build_plugin
|
||||
settings:
|
||||
dry_run: true
|
||||
registry: gitea.ocram85.com
|
||||
repo: test
|
||||
dockerfile: Dockerfile
|
||||
platforms: linux/amd64
|
||||
auto_tag: true
|
||||
build_args:
|
||||
- VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}}
|
||||
- TAG=${CI_COMMIT_TAG}
|
||||
when:
|
||||
event: pull_request
|
||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||
|
||||
publish:
|
||||
image: *build_plugin
|
||||
settings:
|
||||
repo: *publish_repos
|
||||
dockerfile: Dockerfile
|
||||
platforms: linux/amd64
|
||||
auto_tag: true
|
||||
logins: *publish_logins
|
||||
build_args:
|
||||
- VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}}
|
||||
- TAG=${CI_COMMIT_TAG}
|
||||
when:
|
||||
event: [push, tag, cron]
|
||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||
|
||||
build-next:
|
||||
image: *build_plugin
|
||||
settings:
|
||||
repo: *publish_repos
|
||||
dockerfile: Dockerfile
|
||||
platforms: linux/amd64
|
||||
tag: next
|
||||
logins: *publish_logins
|
||||
build_args:
|
||||
- VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}}
|
||||
- TAG=${CI_COMMIT_TAG}
|
||||
when:
|
||||
event: [pull_request]
|
||||
|
||||
gitea-release:
|
||||
image: plugins/gitea-release
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: RENOVATE_TOKEN
|
||||
base_url: https://gitea.ocram85.com
|
||||
title: ${CI_COMMIT_TAG}
|
||||
note: "> :bulb: **Note:** See [CHANGELOG.md](src/branch/master/CHANGELOG.md) for recent changes."
|
||||
when:
|
||||
event: [tag]
|
||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
FROM curlimages/curl:8.7.1
|
||||
|
||||
ENV PLUGIN_OWNER
|
||||
ENV PLUGIN_PACKAGE_NAME
|
||||
ENV PLUGIN_PACKAGE_VERSION
|
||||
ENV PLUGIN_FILE_NAME
|
||||
|
||||
ENV PLUGIN_UPDATE
|
||||
|
||||
COPY gitea-package.sh /app
|
||||
WORKDIR /app
|
||||
CMD [ "gitea-package.sh" ]
|
49
gitea-package.sh
Normal file
49
gitea-package.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
|
||||
say() {
|
||||
if [ -n "$2" ]; then
|
||||
printf "🤖 \e[32mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1"
|
||||
else
|
||||
printf "🤖 \e[32mgitea-package\e[0m: %s \n" "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
sayE() {
|
||||
if [ -n "$2" ]; then
|
||||
printf "🤖 \e[31mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1" 1>&2
|
||||
else
|
||||
printf "🤖 \e[31mgitea-package\e[0m: %s \n" "$1" 1>&2
|
||||
fi
|
||||
}
|
||||
|
||||
sayW() {
|
||||
if [ -n "$2" ]; then
|
||||
printf "🤖 \e[33mgitea-package\e[0m \e[36m[⚒️ %s]\e[0m: %s \n" "$2" "$1" 1>&2
|
||||
else
|
||||
printf "🤖 \e[33mgitea-package\e[0m: %s \n" "$1" 1>&2
|
||||
fi
|
||||
}
|
||||
|
||||
showHelp() {
|
||||
cat << HELP
|
||||
🤖 gitea-package Woodpecker-CI Plugin
|
||||
|
||||
Syntax:
|
||||
HELP
|
||||
}
|
||||
|
||||
showENV () {
|
||||
say "PLUGIN_OWNER: $PLUGIN_OWNER"
|
||||
say "PLUGIN_PACKAGE_NAME: $PLUGIN_PACKAGE_NAME"
|
||||
say "PLUGIN_PACKAGE_VERSION: $PLUGIN_PACKAGE_VERSION"
|
||||
say "PLUGIN_FILE_NAME: $PLUGIN_FILE_NAME"
|
||||
say "PLUGIN_UPDATE: $PLUGIN_UPDATE"
|
||||
}
|
||||
|
||||
main() {
|
||||
showENV
|
||||
}
|
||||
|
||||
main "$@"
|
Loading…
Reference in New Issue
Block a user