mirror of
https://codeberg.org/woodpecker-plugins/go-plugin.git
synced 2024-12-26 20:37:43 +01:00
Woodpecker CI plugin library
738d85cc8e
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [docker.io/woodpeckerci/plugin-ready-release-go](https://github.com/woodpecker-ci/plugin-ready-release-go) | major | `2.1.1` -> `3.0.0` | --- ### Release Notes <details> <summary>woodpecker-ci/plugin-ready-release-go (docker.io/woodpeckerci/plugin-ready-release-go)</summary> ### [`v3.0.0`](https://github.com/woodpecker-ci/plugin-ready-release-go/blob/HEAD/CHANGELOG.md#300---2024-12-02) [Compare Source](https://github.com/woodpecker-ci/plugin-ready-release-go/compare/2.1.1...3.0.0) ##### ❤️ Thanks to all contributors! ❤️ [@​6543](https://github.com/6543), [@​anbraten](https://github.com/anbraten), [@​xoxys](https://github.com/xoxys) ##### 💥 Breaking changes - Disable commentOnReleasedPullRequests by default \[[#​253](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/253)] ##### 📈 Enhancement - Add tests for changelog generation \[[#​245](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/245)] - Use separate build stage to install dependencies and share node_modules \[[#​244](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/244)] ##### 📦️ Dependency - chore(deps): lock file maintenance \[[#​252](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/252)] - chore(deps): update dependency prettier to v3.4.1 \[[#​251](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/251)] - chore(deps): update dependency [@​types/node](https://github.com/types/node) to v22.10.1 \[[#​250](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/250)] - chore(deps): update vitest monorepo to v2.1.6 \[[#​249](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/249)] - chore(deps): lock file maintenance \[[#​243](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/243)] - chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to v0.43.0 \[[#​241](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/241)] - chore(deps): update dependency [@​types/node](https://github.com/types/node) to v22.9.3 \[[#​240](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/240)] - chore(deps): lock file maintenance \[[#​236](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/236)] - chore(deps): update dependency typescript to v5.7.2 \[[#​239](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/239)] - chore(deps): update dependency [@​types/node](https://github.com/types/node) to v22.9.2 \[[#​238](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/238)] - chore(deps): update vitest monorepo to v2.1.5 \[[#​235](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/235)] - chore(deps): lock file maintenance \[[#​232](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/232)] - chore(deps): update woodpeckerci/plugin-ready-release-go docker tag to v2.1.1 \[[#​231](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/231)] - chore(deps): lock file maintenance \[[#​229](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/229)] ##### Misc - Add release-please to readme \[[#​248](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/248)] - Separate pr-labels to changes code into an analyser \[[#​237](https://github.com/woodpecker-ci/plugin-ready-release-go/pull/237)] </details> --- ### Configuration 📅 **Schedule**: Branch creation - "* * * * 0,6" (UTC), Automerge - "* 0-3 * * *" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS41Ni4yIiwidXBkYXRlZEluVmVyIjoiMzkuNTYuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jeSJdfQ==--> Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/37 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: woodpecker-bot <woodpecker-bot@obermui.de> Co-committed-by: woodpecker-bot <woodpecker-bot@obermui.de> |
||
---|---|---|
.woodpecker | ||
.gitignore | ||
CHANGELOG.md | ||
commit.go | ||
flags.go | ||
flake.lock | ||
flake.nix | ||
forge.go | ||
go.mod | ||
go.sum | ||
http.go | ||
LICENSE | ||
logger.go | ||
metadata_test.go | ||
metadata.go | ||
pipeline.go | ||
plugin_test.go | ||
plugin.go | ||
README.md | ||
renovate.json | ||
repo.go | ||
step.go | ||
system.go |
Library for creating Woodpecker CI plugins
Provides basic structure and helpers to load Woodpecker CI environment variables while also supporting reading Drone CI environment variables where available.
Adds logging support based on zerolog library and allows configurable HTTP client library.
Builtin settings
Settings Name | Environment variable | Default | Description | |
---|---|---|---|---|
log_level |
- | info |
Sets log level (panic , fatal , error , warn , info , debug , trace ) |
|
skip_verify |
- | false |
- | Skip verification of TLS certificate |
SOCKS_PROXY |
none | SOCKS5 proxy to use for connections | ||
SOCKS_PROXY_OFF |
none | Do not use SOCKS5 proxy |
Creating plugin
package main
import (
"context"
"codeberg.org/woodpecker-plugins/go-plugin"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v3"
)
type Settings struct {
// TODO: Plugin settings
SampleFlag string
}
type Plugin struct {
*plugin.Plugin
Settings *Settings
}
func (p *Plugin) Flags() []cli.Flag {
return []cli.Flag{
// TODO: Add flags
&cli.StringFlag{
Name: "sample.flag",
Usage: "sample flag",
Sources: cli.EnvVars("PLUGIN_SAMPLE_FLAG"),
Destination: &p.Settings.SampleFlag,
},
}
}
func (p *Plugin) Execute(ctx context.Context) error {
// TODO: Implement execution
log.Debug().Msg("executed")
return nil
}
func main() {
p := &Plugin{
Settings: &Settings{},
}
p.Plugin = plugin.New(plugin.Options{
Name: "sample-plugin",
Description: "Sample plugin",
Flags: p.Flags(),
Execute: p.Execute,
})
p.Run()
}