From 0aee9d73423ad46dd88b9be60d2875426b90774e Mon Sep 17 00:00:00 2001 From: Anbraten <6918444+anbraten@users.noreply.github.com> Date: Mon, 15 Apr 2024 21:18:02 +0200 Subject: [PATCH 1/2] fix cli config loading and correct comment (#3618) closes #3553 https://github.com/woodpecker-ci/woodpecker/pull/3518#discussion_r1542662674 --- cli/common/hooks.go | 2 +- cli/internal/config/config.go | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cli/common/hooks.go b/cli/common/hooks.go index 5febcfa13a..952742cba2 100644 --- a/cli/common/hooks.go +++ b/cli/common/hooks.go @@ -57,7 +57,7 @@ func After(_ *cli.Context) error { if waitForUpdateCheck != nil { select { case <-waitForUpdateCheck.Done(): - // When the actual command already finished, we still wait 250ms for the update check to finish + // When the actual command already finished, we still wait 500ms for the update check to finish case <-time.After(time.Millisecond * 500): log.Debug().Msg("Update check stopped due to timeout") cancelWaitForUpdate(errors.New("update check timeout")) diff --git a/cli/internal/config/config.go b/cli/internal/config/config.go index 77405dc66b..50d32bec0d 100644 --- a/cli/internal/config/config.go +++ b/cli/internal/config/config.go @@ -30,9 +30,12 @@ func Load(c *cli.Context) error { return err } - if config == nil && !c.IsSet("server-url") && !c.IsSet("token") { - log.Info().Msg("The woodpecker-cli is not yet set up. Please run `woodpecker-cli setup`") - return errors.New("woodpecker-cli is not setup") + if config == nil { + config = &Config{ + LogLevel: "info", + ServerURL: c.String("server-url"), + Token: c.String("token"), + } } if !c.IsSet("server") { @@ -56,6 +59,11 @@ func Load(c *cli.Context) error { } } + if config.ServerURL == "" || config.Token == "" { + log.Info().Msg("The woodpecker-cli is not yet set up. Please run `woodpecker-cli setup` or provide the required environment variables / flags.") + return errors.New("woodpecker-cli is not configured") + } + return nil } From 0a38fb89db8614e2779616f7330cd96b491111ac Mon Sep 17 00:00:00 2001 From: Elara Date: Mon, 15 Apr 2024 22:43:10 -0700 Subject: [PATCH 2/2] Add Twine plugin (#3619) This PR adds my plugin for the [Twine](https://github.com/pypa/twine/) tool. It lets users upload python projects to PyPi. --- docs/plugins/woodpecker-plugins/plugins.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/plugins/woodpecker-plugins/plugins.json b/docs/plugins/woodpecker-plugins/plugins.json index 8480438cdc..a1c68db2fb 100644 --- a/docs/plugins/woodpecker-plugins/plugins.json +++ b/docs/plugins/woodpecker-plugins/plugins.json @@ -194,6 +194,11 @@ "name": "Forge deployments", "docs": "https://raw.githubusercontent.com/woodpecker-ci/plugin-deployments/main/docs.md", "verified": true + }, + { + "name": "Twine", + "docs": "https://gitea.elara.ws/music-kraken/plugin-twine/raw/branch/master/docs.md", + "verified": false } ] }