mirror of
https://codeberg.org/woodpecker-plugins/go-plugin.git
synced 2024-11-24 14:25:38 +01:00
Woodpecker CI plugin library
18a1562886
Welcome to [Renovate](https://github.com/renovatebot/renovate)! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin. 🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged. --- ### Detected Package Files * `go.mod` (gomod) * `.woodpecker.yaml` (woodpecker) ### Configuration Summary Based on the default config's presets, Renovate will: - Start dependency updates only once this onboarding PR is merged - Enable Renovate Dependency Dashboard creation. - Use semantic commit type `fix` for dependencies and `chore` for all others if semantic commits are in use. - Ignore `node_modules`, `bower_components`, `vendor` and various test/tests directories. - Group known monorepo packages together. - Use curated list of recommended non-monorepo package groupings. - Apply crowd-sourced package replacement rules. - Apply crowd-sourced workarounds for known problems with packages. - Run lock file maintenance (updates) early Monday mornings. - Schedule automerge daily. - Schedule for weekends. - Enable Renovate Dependency Dashboard creation. - Use semantic commit type `fix` for dependencies and `chore` for all others if semantic commits are in use. - Ignore `node_modules`, `bower_components`, `vendor` and various test/tests directories. - Group known monorepo packages together. - Use curated list of recommended non-monorepo package groupings. - Apply crowd-sourced package replacement rules. - Apply crowd-sourced workarounds for known problems with packages. - Run lock file maintenance (updates) early Monday mornings. - Schedule automerge daily. - Schedule for weekends. - Run Renovate on following schedule: every weekend 🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the `renovate.json` in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs. --- ### What to Expect With your current configuration, Renovate will create 7 Pull Requests: <details> <summary>Update module github.com/stretchr/testify to v1.8.4</summary> - Schedule: ["every weekend"] - Branch name: `renovate/github.com-stretchr-testify-1.x` - Merge into: `main` - Upgrade [github.com/stretchr/testify](https://github.com/stretchr/testify) to `v1.8.4` </details> <details> <summary>Update golang Docker tag to v1.21</summary> - Schedule: ["every weekend"] - Branch name: `renovate/golang-1.x` - Merge into: `main` - Upgrade golang to `1.21` </details> <details> <summary>Update golangci/golangci-lint Docker tag to v1.54</summary> - Schedule: ["every weekend"] - Branch name: `renovate/golangci-golangci-lint-1.x` - Merge into: `main` - Upgrade golangci/golangci-lint to `v1.54-alpine` </details> <details> <summary>Update module github.com/joho/godotenv to v1.5.1</summary> - Schedule: ["every weekend"] - Branch name: `renovate/github.com-joho-godotenv-1.x` - Merge into: `main` - Upgrade [github.com/joho/godotenv](https://github.com/joho/godotenv) to `v1.5.1` </details> <details> <summary>Update module github.com/rs/zerolog to v1.31.0</summary> - Schedule: ["every weekend"] - Branch name: `renovate/github.com-rs-zerolog-1.x` - Merge into: `main` - Upgrade [github.com/rs/zerolog](https://github.com/rs/zerolog) to `v1.31.0` </details> <details> <summary>Update module github.com/urfave/cli/v2 to v2.25.7</summary> - Schedule: ["every weekend"] - Branch name: `renovate/github.com-urfave-cli-v2-2.x` - Merge into: `main` - Upgrade [github.com/urfave/cli/v2](https://github.com/urfave/cli) to `v2.25.7` </details> <details> <summary>Update module golang.org/x/net to v0.17.0</summary> - Schedule: ["every weekend"] - Branch name: `renovate/golang.org-x-net-0.x` - Merge into: `main` - Upgrade golang.org/x/net to `v0.17.0` </details> <br /> 🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or overwhelm the project. See docs for `prhourlylimit` for details. --- ❓ Got questions? Check out Renovate's [Docs](https://docs.renovatebot.com/), particularly the Getting Started section. If you need any further assistance then you can also [request help here](https://github.com/renovatebot/renovate/discussions). --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-config-hash:d0f89381ee26ddd9055d24c12fa2ffc765c573491e687875e761186223a52bc4--> Reviewed-on: https://codeberg.org/woodpecker-plugins/go-plugin/pulls/4 Co-authored-by: Patrick Schratz <pat-s@mailbox.org> Co-committed-by: Patrick Schratz <pat-s@mailbox.org> |
||
---|---|---|
.woodpecker.yaml | ||
commit.go | ||
flags.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 |
- |
SOCKS_PROXY |
none | SOCKS5 proxy to use for connections | |
SOCKS_PROXY_OFF |
none | Do not use SOCKS5 proxy |
Creating plugin
import (
"context"
"codeberg.org/woodpecker-plugins/go-plugin"
"github.com/urfave/cli/v2"
"github.com/rs/zerolog/log"
)
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",
EnvVars: []string{"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{}
}
p.Plugin = plugin.New(Options{
Name: "sample-plugin",
Description: "Sample plugin",
Flags: p.Flags(),
Execute: p.Execute,
})
p.Run()
}