6543
936c9bdb0d
Export changed files via builtin environment variables ( #2935 )
...
add **`CI_PIPELINE_FILES`** to builtin env vars
close #853
---
*Sponsored by Kithara Software GmbH*
2023-12-18 22:37:38 +01:00
gapanyc
547f5dea35
Init CI_COMMIT_TAG if commit ref is a tag ( #2934 )
...
When triggering a deployment event on an existing pipeline, there is no
way to get the tag used to trigger the parent pipeline, even if this
parent was a tag event.
In our company CI/CD current setup with drone, we use the tag event to
trigger a kaniko image build step, using the git tag as an image tag,
and the deployment/promotion step to effectively deploy this image using
the tag reference in our cluster. This is the only point blocking us to
completely switch to woodpecker and get rid of drone...
What's done:
- changed the metadata environ() method to populate CI_COMMIT_TAG env
var if commit ref starts with /refs/tags (like it's done in drone),
independently of event type EventTag.
Please let me know if I'm wrong, I will happily contribute in this nice
project.
---------
Co-authored-by: Christian Gapany <christian.gapany@netplus.pro>
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-12-12 18:05:06 +02:00
Nikolai Rodionov
b3541e314e
fix: Add backend_options
to service linter entry ( #2930 )
...
I've tried setting resources for a service and have seen the linter
warning that is not supported, though the the pipeline was successful
and resources were actually set on the pod. So I assume it shouldn't be
a linter issue.
I"m also not sure if my change is correct, I only hope it is
## Some Context
A pipeline example (I've removed steps that are not related directly:
```yaml
---
steps:
test:
name: Test charts
image: quay.io/helmpack/chart-testing
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- export PATH=$PWD/.bin:$PATH
- apk update && apk add docker
- kind create cluster --config kind.yaml
- sed -i -E -e 's/localhost|0\.0\.0\.0/docker/g' ~/.kube/config
- git fetch origin
- |
if [ -e .changed ]; then
ct install --target-branch main --chart-dirs .
ct install --target-branch main --chart-dirs . --upgrade
fi
services:
docker:
image: docker:dind
commands: dockerd -H tcp://0.0.0.0:2375 --tls=false
privileged: true
ports:
- 2375
backend_options:
kubernetes:
resources:
requests:
memory: 400Mi
cpu: 100m
limits:
memory: 400Mi
cpu: 100m
```
Pod description:
```
Containers:
wp-01hhczdknafj81jv80gzjbgt93-0-services-0:
Limits:
cpu: 100m
memory: 400Mi
Requests:
cpu: 100m
memory: 400Mi
```
Warning in the Woodpecker UI:
```
[linter]woodpecker: services.dockerAdditional property backend_options is not allowed
```
2023-12-11 19:22:55 +01:00
runephilosof-karnovgroup
adb2c82790
Update go module path for major version 2 ( #2905 )
...
https://go.dev/doc/modules/release-workflow#breaking
Fixes https://github.com/woodpecker-ci/woodpecker/issues/2913 fixes
#2654
```
runephilosof@fedora:~/code/platform-woodpecker/woodpecker-repo-configurator (master)$ go get go.woodpecker-ci.org/woodpecker@v2.0.0
go: go.woodpecker-ci.org/woodpecker@v2.0.0: invalid version: module contains a go.mod file, so module path must match major version ("go.woodpecker-ci.org/woodpecker/v2")
```
---------
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-08 08:15:08 +01:00
Lauris BH
511cfec66a
Fix schema validation with array syntax for clone and services ( #2920 )
...
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
Co-authored-by: Anbraten <anton@ju60.de>
2023-12-07 16:56:13 +01:00
renovate[bot]
428fe659fe
Update golang (packages) ( #2904 )
...
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg )](https://renovatebot.com )
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| code.gitea.io/sdk/gitea | require | minor | `v0.16.0` -> `v0.17.0` |
| [github.com/antonmedv/expr](https://togithub.com/antonmedv/expr ) |
require | patch | `v1.15.5` -> `v1.15.6` |
| [github.com/golang-jwt/jwt/v5](https://togithub.com/golang-jwt/jwt ) |
require | minor | `v5.1.0` -> `v5.2.0` |
| [github.com/urfave/cli/v2](https://togithub.com/urfave/cli ) | require
| minor | `v2.25.7` -> `v2.26.0` |
---
### Release Notes
<details>
<summary>antonmedv/expr (github.com/antonmedv/expr)</summary>
###
[`v1.15.6`](https://togithub.com/expr-lang/expr/releases/tag/v1.15.6 )
[Compare
Source](https://togithub.com/antonmedv/expr/compare/v1.15.5...v1.15.6 )
- This is a new release for `expr-lang/epxr`.
</details>
<details>
<summary>golang-jwt/jwt (github.com/golang-jwt/jwt/v5)</summary>
### [`v5.2.0`](https://togithub.com/golang-jwt/jwt/releases/tag/v5.2.0 )
[Compare
Source](https://togithub.com/golang-jwt/jwt/compare/v5.1.0...v5.2.0 )
#### What's Changed
- Exported `NewValidator` by
[@​oxisto](https://togithub.com/oxisto ) in
[https://github.com/golang-jwt/jwt/pull/349 ](https://togithub.com/golang-jwt/jwt/pull/349 )
- Improve ErrInvalidKeyType error messages by
[@​Laurin-Notemann](https://togithub.com/Laurin-Notemann ) in
[https://github.com/golang-jwt/jwt/pull/361 ](https://togithub.com/golang-jwt/jwt/pull/361 )
- Update MIGRATION_GUIDE.md by
[@​jbarham](https://togithub.com/jbarham ) in
[https://github.com/golang-jwt/jwt/pull/363 ](https://togithub.com/golang-jwt/jwt/pull/363 )
#### New Contributors
- [@​Laurin-Notemann](https://togithub.com/Laurin-Notemann ) made
their first contribution in
[https://github.com/golang-jwt/jwt/pull/361 ](https://togithub.com/golang-jwt/jwt/pull/361 )
- [@​jbarham](https://togithub.com/jbarham ) made their first
contribution in
[https://github.com/golang-jwt/jwt/pull/363 ](https://togithub.com/golang-jwt/jwt/pull/363 )
**Full Changelog**:
https://github.com/golang-jwt/jwt/compare/v5.1.0...v5.2.0
</details>
<details>
<summary>urfave/cli (github.com/urfave/cli/v2)</summary>
### [`v2.26.0`](https://togithub.com/urfave/cli/releases/tag/v2.26.0 )
[Compare
Source](https://togithub.com/urfave/cli/compare/v2.25.7...v2.26.0 )
#### What's Changed
- Bash completion nits by
[@​meatballhat](https://togithub.com/meatballhat ) in
[https://github.com/urfave/cli/pull/1762 ](https://togithub.com/urfave/cli/pull/1762 )
- Chore: Rename mkdocs requirements file name by
[@​dearchap](https://togithub.com/dearchap ) in
[https://github.com/urfave/cli/pull/1776 ](https://togithub.com/urfave/cli/pull/1776 )
- Fix:(issue\_1787) Add fix for commands not listed when hide help
comma… by [@​dearchap](https://togithub.com/dearchap ) in
[https://github.com/urfave/cli/pull/1788 ](https://togithub.com/urfave/cli/pull/1788 )
- Fix nil HelpFlag panic (v2) by
[@​wxiaoguang](https://togithub.com/wxiaoguang ) in
[https://github.com/urfave/cli/pull/1795 ](https://togithub.com/urfave/cli/pull/1795 )
- Always get 0 for a nested int64 value in v2.25.7 by
[@​stephenfire](https://togithub.com/stephenfire ) in
[https://github.com/urfave/cli/pull/1799 ](https://togithub.com/urfave/cli/pull/1799 )
- Helper messages for documenting build process by
[@​abitrolly](https://togithub.com/abitrolly ) in
[https://github.com/urfave/cli/pull/1800 ](https://togithub.com/urfave/cli/pull/1800 )
- fix: check duplicated sub command name and alias by
[@​linrl3](https://togithub.com/linrl3 ) in
[https://github.com/urfave/cli/pull/1805 ](https://togithub.com/urfave/cli/pull/1805 )
- Fix:(issue\_1689) Have consistent behavior for default text in man
and… by [@​dearchap](https://togithub.com/dearchap ) in
[https://github.com/urfave/cli/pull/1825 ](https://togithub.com/urfave/cli/pull/1825 )
- Fix linting issues by
[@​skelouse](https://togithub.com/skelouse ) in
[https://github.com/urfave/cli/pull/1696 ](https://togithub.com/urfave/cli/pull/1696 )
#### New Contributors
- [@​stephenfire](https://togithub.com/stephenfire ) made their
first contribution in
[https://github.com/urfave/cli/pull/1799 ](https://togithub.com/urfave/cli/pull/1799 )
- [@​linrl3](https://togithub.com/linrl3 ) made their first
contribution in
[https://github.com/urfave/cli/pull/1805 ](https://togithub.com/urfave/cli/pull/1805 )
**Full Changelog**:
https://github.com/urfave/cli/compare/v2.25.7...v2.26.0
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 4am" (UTC), Automerge -
"before 4am" (UTC).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions ) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/ ). View
repository job log
[here](https://developer.mend.io/github/woodpecker-ci/woodpecker ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44MS4zIiwidXBkYXRlZEluVmVyIjoiMzcuODEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <ndev@web.de>
2023-12-04 20:53:46 +01:00
Thomas Anderson
3adb98b287
Simple security context options (Kubernetes) ( #2550 )
2023-11-26 08:46:06 +01:00
qwerty287
342b25826c
Rename link
to url
( #2812 )
...
As of https://woodpecker-ci.org/docs/next/usage/terminiology#conventions
2023-11-14 17:12:12 +01:00
qwerty287
6a7e91bb0e
Fix env vars and add UI url ( #2811 )
...
Closes https://github.com/woodpecker-ci/woodpecker/issues/2219
---------
Co-authored-by: Anbraten <anton@ju60.de>
2023-11-13 09:38:02 +01:00
qwerty287
70711ed9db
Replace interface{}
with any
( #2807 )
...
like golang:
2580d0e08d
2023-11-12 18:23:48 +01:00
Patrick Schratz
f3df6f8873
Add privileged
schema definition ( #2777 )
...
Co-authored-by: 6543 <m.huber@kithara.com>
2023-11-09 19:31:08 +01:00
6543
5a7b689e30
Switch to go vanity urls ( #2706 )
...
Co-authored-by: Anbraten <anton@ju60.de>
2023-11-07 08:04:33 +01:00
qwerty287
1bc4415075
Add workflow version ( #2476 )
...
Closes #1834
---------
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-11-06 01:37:02 +01:00
Anbraten
9e10100ad6
Fail on missing secrets ( #2749 )
...
Co-authored-by: pat-s <patrick.schratz@gmail.com>
2023-11-05 12:47:42 +01:00
Anbraten
a0f2ee9506
Add deprecation warnings ( #2725 )
2023-11-04 15:30:47 +01:00
Anbraten
5ff006614f
Enhance linter and errors ( #1572 )
...
Co-authored-by: 6543 <m.huber@kithara.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-11-03 11:44:03 +01:00
qwerty287
c1faa95d8f
Revert breaking pipeline changes ( #2677 )
...
Revert #2180 and #2480 so we can release v2.0 without breaking changes
in pipeline config.
After merging #2476 we should apply these changes to a new v2.
After merging this, we should be ready for the 2.0 release.
---------
Co-authored-by: Anbraten <anton@ju60.de>
2023-11-02 15:31:49 +01:00
Thomas Anderson
de53b906e8
Add ports into pipeline backend step model ( #2656 )
...
Closes #2655 .
[Pipeline](https://woodpecker-ci.org/docs/next/usage/services#complete-pipeline-example ):
```yaml
services:
database:
image: mysql
environment:
- MYSQL_DATABASE=test
- MYSQL_ROOT_PASSWORD=example
ports:
- 3306
steps:
get-version:
image: ubuntu
commands:
- ( apt update && apt dist-upgrade -y && apt install -y mysql-client 2>&1 )> /dev/null
- sleep 60s # need to wait for mysql-server init
- echo 'SHOW VARIABLES LIKE "version"' | mysql -uroot -hdatabase test -pexample
```
Service:
```yaml
apiVersion: v1
kind: Service
metadata:
name: wp-01hdq6gbkw1mn6k1655fs3rntf-0-services-0
namespace: woodpecker-runtime
...
selfLink: >-
/api/v1/namespaces/woodpecker-runtime/services/wp-01hdq6gbkw1mn6k1655fs3rntf-0-services-0
status:
loadBalancer: {}
spec:
ports:
- protocol: TCP
port: 3306
targetPort: 3306
selector:
step: database
clusterIP: 10.43.180.120
clusterIPs:
- 10.43.180.120
type: ClusterIP
sessionAffinity: None
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
internalTrafficPolicy: Cluster
```
2023-11-02 04:12:41 +01:00
6543
e83357833d
Use path.Join for server side path generation ( #2689 )
...
make sure to have valid config even when server is running under windows
---
*Sponsored by Kithara Software GmbH*
2023-11-01 11:29:44 +01:00
qwerty287
e74115027b
Add some tests ( #2652 )
...
and some cleanups
2023-10-28 13:37:54 +02:00
Anbraten
f44aa8a6fd
Remove plugin-only option from secrets ( #2213 )
2023-10-24 20:38:47 +02:00
Anbraten
62d6a6bc34
Move skip-ci back in front of config fetching ( #2555 )
2023-10-09 18:15:53 +02:00
qwerty287
46273e54d8
Require Go 1.21 ( #2553 )
...
Main change are the new `maps` and `slices` stdlib packages so we can
replace `golang.org/x/exp`.
2023-10-09 09:11:08 +02:00
renovate[bot]
e8ef1fb3c1
fix(deps): update module github.com/docker/distribution to v2.8.3+incompatible ( #2517 )
2023-10-03 09:35:40 +02:00
qwerty287
842e8a8e50
Remove deprecated options parsing ( #2480 )
...
Main change is that backwards compatibility to `platform` was removed.
Part of
https://github.com/woodpecker-ci/woodpecker/discussions/2170#discussioncomment-7047394
2023-09-20 13:48:34 +02:00
Kleber Rocha
61b5672051
Add option to configure tolerations in kubernetes backend ( #2249 )
...
This code add a feature to support tolerations in Kubernetes Backend
---------
Signed-off-by: Kleber Rocha <klinux@gmail.com>
2023-08-22 22:34:59 +02:00
6543
55e98a186a
Skip settings proxy config with WithProxy if its empty ( #2242 )
...
close #2208
2023-08-18 13:09:28 +02:00
6543
a5ef372190
Move "skip ci" logic into global pipeline conditions ( #2216 )
...
... and make custom errors follow std err conventions
this fix a 500 response if the whole pipeline is filtered out
2023-08-17 15:52:43 +02:00
6543
0563d7a30f
Bump default git clone plugin ( #2215 )
...
- and add alternate quay registry to trusted clone image
- add alternate registry for buildx plugin
2023-08-16 15:17:43 +02:00
qwerty287
4d83ea0de8
Add SSH clone URL env var ( #2198 )
...
to improve https://github.com/woodpecker-ci/plugin-git/pull/75
2023-08-12 17:39:13 +02:00
qwerty287
8cdac56d8f
Check for correct license header ( #2137 )
2023-08-10 11:06:00 +02:00
6543
eb8fb407f9
Add TestCompilerCompile ( #2183 )
...
just add tests about compile frontend config into backend config
2023-08-10 09:52:52 +02:00
6543
23ad363c97
fix error message
2023-08-10 00:01:16 +02:00
6543
63d5c40afd
Deprecate "platform" filter in favour of "labels" ( #2181 )
...
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-08-09 16:09:44 +02:00
6543
71666f0500
Fail hard on deprecated pipeline keys ( #2180 )
...
so we can drop it in next minor version complete
2023-08-09 15:33:10 +02:00
Anbraten
f02eaa115e
Pass netrc to trusted clone images ( #2163 )
...
closes #1975
2023-08-08 12:49:29 +02:00
6543
d253f8cc30
Make sure we dont have hidden options for backend and pipeline compiler ( #2123 )
...
move options based on **os.Getenv** into flags
---------
*Sponsored by Kithara Software GmbH*
2023-08-07 21:13:26 +02:00
6543
10b1cfcd3b
Enhance local backend ( #2017 )
...
make local backend able to clone from private
---------
*Sponsored by Kithara Software GmbH*
Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2023-08-07 15:39:58 +02:00
Anbraten
e0ed1b3e49
Change master to main ( #2044 )
2023-07-31 05:47:23 +02:00
6543
da9bfa64ce
Fix docs nit and add rm todo for v1.2.0 ( #2049 )
2023-07-28 15:33:23 +02:00
6543
a83b0fcfd3
Drop deprecated built-in environment variables ( #2048 )
...
Drop:
- `CI_BUILD_*`
- `CI_PREV_BUILD_*`
- `CI_JOB_*`
- `*_LINK`
- `CI_SYSTEM_ARCH`
- `CI_REPO_REMOTE`
2023-07-28 14:58:20 +02:00
6543
b54f6ebad6
Let pipeline-compiler export step types ( #1958 )
2023-07-11 15:53:05 +02:00
Anbraten
f2c33a0d89
Fix netrc passing to clone image ( #1964 )
...
closes #1837
2023-07-09 23:41:13 +02:00
6543
5393aa5d3b
Move docker specific volume & network settings into backend code ( #1956 )
...
... if we want to make them be changed ... it should be an
agent-backend-option
2023-07-09 21:03:19 +02:00
6543
de13aeea33
Remove unused step options ( #1957 )
...
remove them as they did never had any functionality
2023-07-09 12:32:19 +02:00
Thomas Anderson
b616a822a0
Fixed when:evaluate on non-standard (non-CI*) env vars ( #1907 )
...
Makes it possible to evaluate `when` constraint on custom environment
variables.
2023-07-02 23:45:22 +02:00
Thomas Anderson
2ba64dcb7d
Removed env vars filtering ( #1913 )
...
Closes #1911
2023-07-02 19:14:59 +02:00
qwerty287
3033abc3b4
Add own workflow model ( #1784 )
...
Closes #1287
---------
Co-authored-by: 6543 <6543@obermui.de>
2023-06-27 18:01:18 +02:00
qwerty287
eaae6b44c7
Remove default event filter ( #1880 )
...
Closes https://github.com/woodpecker-ci/woodpecker/issues/1863
2023-06-21 18:12:20 +02:00
Ovidiu Calbajos
609ba481b5
Support for k8s serviceAccount and nodeSelector ( #1842 )
...
Add the possiblity to specify the Kubernetes serviceAccount and/or
nodeSelector to be used on individual steps for Kubernetes executor
2023-06-12 16:00:59 +02:00
6543
7e708874ae
Rename yaml pipeline to steps ( #1833 )
...
Adjust pipeline-config to match
[Terminology](https://woodpecker-ci.org/docs/next/usage/terminology )
2023-06-07 12:04:37 +02:00
Anbraten
556607b525
Rework log streaming and related functions ( #1802 )
...
closes #1801
closes #1815
closes #1144
closes #983
closes #557
closes #1827
regression of #1791
# TODO
- [x] adjust log model
- [x] add migration for logs
- [x] send log line via grpc using step-id
- [x] save log-line to db
- [x] stream log-lines to UI
- [x] use less structs for log-data
- [x] make web UI work
- [x] display logs loaded from db
- [x] display streaming logs
- [ ] ~~make migration work~~ -> dedicated pull (#1828 )
# TESTED
- [x] new logs are stored in database
- [x] log retrieval via cli (of new logs) works
- [x] log streaming works (tested via curl & webui)
- [x] log retrieval via web (of new logs) works
---------
Co-authored-by: 6543 <6543@obermui.de>
2023-06-06 09:52:08 +02:00
6543
971cb52032
Rename pipeline frontend types ( #1829 )
...
this adjust the packages that parse the yaml-config-file to match
[Terminology](https://woodpecker-ci.org/docs/next/usage/terminology )
2023-06-06 09:14:21 +02:00
6543
f81b447638
remove undocumented docker specific option ( #1825 )
2023-06-05 17:30:32 +02:00
6543
ea895baf83
Resolve built-in variables for global when filter ( #1790 )
...
addresses
bd461477bd
close #1244 , close #1580
---------
Co-authored-by: Anbraten <anton@ju60.de>
2023-06-05 00:15:07 +02:00
Stephen Muth
2941e508b3
Allow setting resources for kubernetes on a per-step basis ( #1767 )
...
This add a simple implementation of requests/limits for individual
steps. There is no validation of what the resource actually is beyond
checking that it can successfully be converted to a Quantity, so it can
be used for things other than just memory/CPU.
close #1809
2023-06-04 00:50:08 +02:00
6543
524611cf00
Add Forge Metadata ( #1789 )
...
close #1787
2023-05-31 18:30:41 +02:00
6543
a1943aa49e
Buildin Env Vars, use _URL for all links/urls ( #1794 )
...
based on https://framadate.org/jVSQHwIGfJYy82IL
close #1793
2023-05-31 18:03:38 +02:00
6543
204d05f447
Implement YAML Map Merge, Overrides, and Sequence Merge Support ( #1720 )
...
close #1192
2023-04-29 14:49:41 +02:00
Anbraten
36b5ae3459
Add env for workflow and step name ( #1693 )
...
closes #1681
2023-04-08 13:15:28 +02:00
Lauris BH
46452fbd84
Update Go dependencies and minimal Go version to 1.20 ( #1650 )
...
Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
2023-03-21 00:48:15 +01:00
6543
e28b43ab19
Only inject netrc to trusted clone plugins ( #1352 )
...
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: 6543 <6543@obermui.de>
2023-03-20 21:17:49 +01:00
qwerty287
7ddc18348f
Only grant privileged to plugins ( #1646 )
...
Closes https://github.com/woodpecker-ci/woodpecker/issues/1525
Co-authored-by: Anbraten <anton@ju60.de>
2023-03-19 03:07:10 +01:00
Anbraten
fa5b0fb96e
Fix linter ( #1647 )
2023-03-18 20:35:27 +01:00
6543
9945e27c01
pipeline compiler: handle nil entrys in settings list ( #1626 )
...
close #1609
2023-03-17 08:54:53 +01:00
Lukas
1b43b0bf20
Add pull request labels as environment variable ( #1321 )
...
Closes #1308
Co-authored-by: Anbraten <anton@ju60.de>
2023-03-17 03:43:04 +01:00
6543
18d3139e9e
Use modern error handling and enforce it via lint ( #1327 )
...
Co-authored-by: Anbraten <anton@ju60.de>
2023-02-02 00:08:02 +01:00
Stephen Muth
bc87208a33
Rework status constraint logic for successes ( #1515 )
...
Since "success" and "failure" are the only two possible values, and
"success" is considered to be included by default, the existing code can
also be simplified a little.
This has the side effect of ignoring the "exclude" part of the
constraint completely. I put it in the tests just to make sure the
workaround in
https://github.com/woodpecker-ci/woodpecker/issues/1181#issuecomment-1347253585
continues to work as expected, but couldn't think of any legitimate use
cases for it.
Fixes #1181
2023-01-02 06:36:57 +01:00
smainz
b8900cdf88
Fix wrong drone env vars ( #1419 )
...
Provide up to date drone compatibility environment variables to each step execution.
closes #1416
Before a step is executed, some environemnt variables are updated.
This ensures, that the updated environment variables are copied to their corresponding `DRONE_` environemt variables.
Side effect is that the `DRONE_` environemnt variables are no longer available in the metadata which should not harm as they are not used inside woodpecker.
2022-11-22 23:57:12 +01:00
Michaël Dierick
7859bde63d
add support for DRONE_COMMIT_SHA alias ( #1421 )
...
[The docker plugin
uses](d0e7d7f01b/cmd/drone-docker/main.go (L43)
)
the `DRONE_COMMIT_SHA` variant. According to [drone
reference](https://docs.drone.io/pipeline/environment/reference/ ) doc,
`DRONE_COMMIT_SHA` and `DRONE_COMMIT` are the same thing (although the
default value in the docker plugin suggests the 8-char short form).
2022-11-16 18:14:06 +01:00
Sergio Fenoll
f0e518a5a2
Add option to ignore failures on steps ( #1219 )
...
closes #1181
closes #834
Adds `ignore_failure` to pipeline steps. When it's set to true,
if the step fails the following steps continue to execute as if no failure had occurred.
---
failure enums idea:
* fail (default) = if other steps run in parallel, wait for them and
then let workflow fail
* cancel = if other steps run in parallel, kill them
* ignore = we mark the step as failed but it wont have any impact
2022-11-15 19:47:27 +01:00
qwerty287
3372d1a87c
Rename remote
to forge
( #1357 )
...
As of #745
Co-authored-by: Anbraten <anton@ju60.de>
2022-11-05 00:35:06 +01:00
6543
b15ca52a63
Move constrain to only have a single command in backend to run to dedicated backends ( #1032 )
...
at the moment we compile a script that we can pipe in as single command
this is because of the constrains the docker backend gives us.
so we move it into the docker backend and eventually get rid of it altogether
2022-10-31 00:26:49 +01:00
Harikesh00
36e42914fa
Renamed procs/jobs to steps in code ( #1331 )
...
Renamed `procs` to `steps` in code for the issue #1288
Co-authored-by: Harikesh Prajapati <harikesh.prajapati@druva.com>
Co-authored-by: qwerty287 <ndev@web.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2022-10-28 17:38:53 +02:00
qwerty287
e568c42e84
Support plugin-only secrets ( #1344 )
...
Closes #1071
2022-10-27 04:21:07 +02:00
qwerty287
f6cac78119
Allow to change directory for steps ( #1329 )
...
Add `directory` YAML key that changes the workdir. Can replace a `cd`
before your commands start or make it possible to run plugins in a
subdirectory.
2022-10-24 16:31:06 +02:00
qwerty287
849e05bb8b
Rename build
to pipeline
in code ( #1224 )
...
Ref: #745
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: 6543 <6543@obermui.de>
2022-10-18 03:24:12 +02:00
Anbraten
287800ac62
Add when evaluate filter ( #1213 )
...
closes #312
closes #224
closes #963
Have a look for
https://github.com/antonmedv/expr/blob/master/docs/Language-Definition.md
2022-10-06 01:49:23 +02:00
Anbraten
f1339412eb
Fix invalid service names for Kubernetes ( #1234 )
...
closes #1232
2022-10-05 13:39:48 +02:00
6543
da997fa34a
Add support sub-settings and secrets in sub-settings ( #1221 )
2022-10-03 19:25:43 +02:00
[X]
b4d89a1cce
Add ability to trigger manual builds ( #1156 )
...
closes #83
closes #240
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2022-09-27 11:05:00 +02:00
Zav Shotan
ec9b0a62a7
Add support for pipeline root.when conditions ( #770 )
...
Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: 6543 <6543@obermui.de>
2022-09-26 09:27:20 +02:00
Alexis Lefebvre
3266e5f3cc
use example.com instead of foo.com ( #1188 )
...
http://example.com/ is a reserved domain name, which is perfect for
examples, while foo.com is a random domain name
2022-09-14 15:20:27 +02:00
6543
795bbd8988
Add dedicated DroneCI env compatibility layer ( #1185 )
...
for more info see `https://github.com/drone-plugins/drone-plugin-lib/pull/37/files ` and c79d49c862
2022-09-14 09:30:37 +02:00
6543
c79d49c862
Delete old fallbacks and compatible stuff ( #791 )
...
Drop ...
* ... DRONE_ and deprecated pipeline environment vars
* ... deprecated sqlite3 file path
2022-09-01 14:31:12 +02:00
6543
383f273392
Add cron feature ( #934 )
...
https://woodpecker-ci.org/docs/usage/cron
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2022-09-01 00:36:32 +02:00
6543
ca84f703e3
Add default event filter ( #1140 )
...
breakout from #934
when new events are added you don't have to worry that pipeline will behave different as it does now with this
Co-authored-by: Anbraten <anton@ju60.de>
2022-08-30 00:36:37 +02:00
6543
9a57602174
Pipeline compiler should not alter specified image ( #1005 )
...
* pipeline compiler should not alter specifyed image
adress #1003
2022-08-26 20:00:11 +02:00
6543
d3eea72663
Bump deps ( #1125 )
...
* upgrade to codeberg.org/6543/go-yaml2json v0.2.1
* upgraded github.com/bmatcuk/doublestar/v4 v4.0.2 => v4.2.0
* upgraded github.com/docker/cli v20.10.14+incompatible => v20.10.17+incompatible
* upgraded github.com/docker/docker v20.10.14+incompatible => v20.10.17+incompatible
* upgraded github.com/gin-gonic/gin v1.7.7 => v1.8.1
* upgraded github.com/golang-jwt/jwt/v4 v4.4.1 => v4.4.2
* upgraded github.com/moby/moby v20.10.14+incompatible => v20.10.17+incompatible
* upgraded github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 => v0.0.0-20220808134915-39b0c02b01ae
* upgraded github.com/lafriks/ttlcache/v3 v3.1.0 => v3.2.0
* upgraded github.com/mattn/go-sqlite3 v1.14.12 => v1.14.15
* upgraded github.com/lib/pq v1.10.5 => v1.10.6
* github.com/prometheus/client_golang v1.12.1 => v1.13.0
* upgraded github.com/urfave/cli/v2 v2.5.1 => v2.11.2
* upgraded github.com/rs/zerolog v1.26.1 => v1.27.0
* upgraded golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 => v0.0.0-20220822191816-0ebed06d0094
* upgraded github.com/xanzy/go-gitlab v0.64.0 => v0.73.1
* upgraded google.golang.org/grpc v1.47.0 => v1.49.0
2022-08-25 08:09:05 +02:00
6543
a46723334b
refactor: use switch-case not try-err ( #1112 )
2022-08-15 14:39:08 +02:00
Lauris BH
5a945c10e9
Fix to show build pipeline parse error ( #1066 )
2022-08-15 14:37:46 +02:00
Anbraten
fc862bf627
Default clone do checkout tags on tag pipeline ( #1110 )
2022-08-15 11:52:30 +02:00
Anbraten
e269890643
Allow multiple when conditions ( #1087 )
...
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: LamaAni <zshotan@bloomberg.net>
2022-08-14 19:32:49 +02:00
6543
69ec44075c
Let single line command be a single command ( #1009 )
...
* rm go-shlex usage
* update
2022-07-19 07:20:27 +02:00
6543
31bad81979
Use external lib to convert yaml to json ( #1028 )
...
this move shared/yml/* into an independent lib
2022-07-17 17:23:31 +02:00
6543
9449b67da9
fix regression from 81dcdea2be
(missmatch)
2022-06-16 23:11:27 +02:00
Zav Shotan
81dcdea2be
Add support for steps to be a list (instead of dict) ( #826 )
...
- Support for pipeline/containers as list
- Support for container name in logs (step.Name)
Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
Co-authored-by: 6543 <6543@obermui.de>
2022-06-13 23:13:09 +02:00
Anbraten
e79ad00826
Add agent tagging / filtering for pipelines ( #902 )
...
Officially support labels for pipelines and agents to improve pipeline picking.
* add pipeline labels
* update, improve docs and add migration
* update proto file
---
closes #304 & #860
2022-05-31 01:12:18 +02:00
6543
e2e094cfda
Revert "Do not run clone step if no pipeline step will run ( #877 )"
...
This reverts commit f05f918b8d
.
2022-05-20 05:20:17 +02:00
qwerty287
f05f918b8d
Do not run clone step if no pipeline step will run ( #877 )
...
Skip the clone step and ignore hook/pipeline if no pipeline step except clone would run. The status reported back to the forge is `success`.
Closes https://github.com/woodpecker-ci/woodpecker/issues/778
2022-05-18 23:25:14 +02:00
6543
7cf5a1545e
Drop deprecated environment vars ( #920 )
2022-05-17 17:26:35 +02:00
6543
4136df7551
Drop VarArgs in steps in favour of settings ( #919 )
...
* drop VarArgs in steps in favour of settings
* update unit tests
2022-05-17 16:43:05 +02:00
qwerty287
687d57217d
Fix branch condition on tags ( #917 )
...
* Fix branch condition on tags
* Add docs
* Update docs/docs/20-usage/20-pipeline-syntax.md
Co-authored-by: Anbraten <anton@ju60.de>
2022-05-16 20:04:00 +02:00
6543
58303dd2a7
Move value of default clone image into shared constant package ( #873 )
2022-04-06 15:30:49 +02:00
Anbraten
6ae7e2cc4f
Fix uppercase from_secrets ( #842 )
...
Secret names where matched based on their lowercase value already just the conversion to lowercase for `from_secrets` was missing.
2022-03-19 12:34:32 +01:00
Lukas Bachschwell
a2315fe931
Do not filter on linux/amd64 per default ( #805 )
...
* Do not filter on linux/amd64 per default & add tests
Tasks with no platform would otherwise not perform on runners with different OS/ARCH combos
Signed-off-by: Lukas Bachschwell <lukas@lbsfilm.at>
Co-authored-by: 6543 <6543@obermui.de>
2022-02-26 22:54:28 +01:00
6543
8ae124d5e6
Remove unused code ( #797 )
...
* delete empty code files
* delete outdated readme
* delete unused code
* dedup license
2022-02-25 21:42:45 +01:00
Zav Shotan
905350fa15
Add support for default clone image environment variable ( #769 )
...
This allows for custom clone images for deployment in air-gap systems.
Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
2022-02-10 17:05:19 +01:00
6543
04eb7935db
Improve compile pipeline ( #699 )
...
Refactor
- use constants for strings
- more tests
- move constraint code into own package
Enhance
- all constrains use doublestart (glob pattern matching) now
Co-authored-by: Anbraten <anton@ju60.de>
2022-01-17 14:43:30 +01:00
6543
2f91bdd4a0
gofumpt -w -l -extra . ( #661 )
2022-01-05 21:50:23 +01:00
6543
dec0eeeed7
Use global branch filter only on events containing branch info ( #659 )
...
- close #581
- delete unused code
- simplify code
- add check to procBuilder to fail on invalid config
2022-01-05 17:54:44 +01:00
6543
ce5247c675
pipeline env migrate CI_TAG & CI_PULL_REQUEST to new CI_COMMIT_TAG & CI_COMMIT_PULL_REQUEST ( #624 )
...
* CI_TAG => CI_COMMIT_TAG
* CI_PULL_REQUEST => CI_COMMIT_PULL_REQUEST
* add TODO for drop with v0.16.0 development
2021-12-19 17:01:03 +01:00
6543
3bd87cda66
use woodpeckerci/plugin-git:latest for clone ( #617 )
2021-12-18 23:05:25 +01:00
John Olheiser
9e8d1a9294
Get secrets in settings ( #604 )
...
* Get secrets in settings
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add error test
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add docs
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2021-12-13 13:33:07 -06:00
6543
0061edcbe2
Remove gopkg.in/yaml.v2 ( #583 )
...
* rm "gopkg.in/yaml.v2"
* fix UnmarshalYAML for Networks & Ulimits
2021-12-08 23:35:51 +01:00
6543
e7cfa902a6
Another fix for settings field in pipeline config ( #579 )
...
close #578
- adjust to new settings field own pipeline config
- more test coverage
- Fix environment parse of settings
- Fix pipeline schema
2021-12-08 18:17:52 +01:00
6543
1172dc3311
Write own yaml2json func ( #570 )
...
* fix regression of #384
* add more tests
2021-12-07 01:13:02 +01:00
Anbraten
ffed327564
Remove ghodss/yaml ( #384 )
2021-12-06 18:17:31 +00:00
John Olheiser
71b9179078
Move plugin config to root.pipeline.[step].settings ( #464 )
...
* Move Vargs to Settings
* Allow both until deprecation
* Add more tests
* Adjust schema
* Add missing detach option, fix schema tests
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Anbraten <anton@ju60.de>
2021-12-04 16:44:18 +01:00
6543
fc6a2a9975
Remove github.com/kr/pretty in favor of assert.EqualValues() ( #564 )
...
* remove github.com/kr/pretty in favor of assert.EqualValues()
* code format
2021-12-04 13:23:33 +01:00
Lukas
680d003a29
Add linter revive ( #554 )
...
* Add linter revive
* Add underscore to variable name to prevent shadowing
* Remove unnecessary leading underscore
* Revert changes to vendor file
* export ConfigFetcher as interface
* no 'yoda conditions'
* rename envsubst
Co-authored-by: 6543 <6543@obermui.de>
2021-12-01 14:22:06 +01:00
Anbraten
c1a8884d62
Add backend selection for agent ( #463 )
...
- add backend selection option
- by default it will auto-detect a backend
2021-11-26 03:34:48 +01:00
Anbraten
f2b6a5c9c5
Fix passing of netrc credentials to clone step ( #492 )
...
closes #479
2021-11-25 21:30:03 +01:00
Anbraten
063d0bb32a
Replace DRONE_ with CI_ variables in pipeline steps ( #427 )
...
Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables.
- `CI_*` prefix replaces `DRONE_*`
- `CI` value is now `woodpecker`
- `DRONE=true` has been removed
2021-11-25 20:43:31 +01:00
Lukas
116c310820
Add linter misspell ( #530 )
...
* Add linter misspell
* Fix spelling
Co-authored-by: Anbraten <anton@ju60.de>
2021-11-24 02:01:12 +01:00
Lukas
25bf91bd37
Add linter whitespace ( #531 )
2021-11-24 01:31:11 +01:00
6543
fe31fb1e06
Drop error only on purpose or else report back or log ( #514 )
...
- Remove Deadcode
- Simplify Code
- Drop error only on purpose
2021-11-23 15:36:52 +01:00
6543
ca8e215cfa
Migrate to Xorm ( #474 )
...
close #234
* Migrate store
* Migrate tests
* Rewrite migrations
* Init fresh DB in on step
* Rm old stuff (meddler, sql files, dead code, ...)
2021-11-13 20:18:06 +01:00
6543
aca5fddcf3
Use Goblin Assert as intended ( #501 )
...
this allow for better debugging if an error occur
2021-11-04 14:42:25 +01:00
6543
0bb62be303
Embedding libcompose types for yaml parsing ( #495 )
...
since github.com/docker/libcompose is deprecated, unmaintained and archived.
and license is the same as woodpecker's, we can just copy stuff into woodpecker directly.
(we only use types of that project anyway)
2021-10-30 17:52:02 +02:00
6543
6828057f66
Switch default git plugin ( #449 )
...
* update pipeline samples
* update docs
* use woodpeckerci/plugin-git:latest as default
* code format nit
2021-10-15 19:54:28 -05:00
John Olheiser
4276a04f0c
Move entirely to zerolog ( #426 )
...
Completely switch to zerolog
(Remove usage of logrus and std logger)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2021-10-12 09:25:13 +02:00
luzpaz
9b687a923e
Fix various typos ( #416 )
...
Fix various typos found via `codespell -q 3 -S vendor -L pullrequest,pullrequests`
2021-10-08 18:35:56 +02:00
Anbraten
bb37836600
Replace drone strings with woodpecker ( #391 )
...
Co-authored-by: 6543 <6543@obermui.de>
2021-10-02 10:59:34 +02:00
6543
0bd10fa507
Cleanup Code ( #348 )
...
* Fix "Empty slice declaration using a literal"
* Fix "collides with imported package name"
* Remove unused code in pipeline
* Remove unused oauth2.providerAuthHeaderWorks()
* Add TODOs
* Format Code
* Cleanup doublestar import
* Migrate deprecated functions
Co-authored-by: Anbraten <anton@ju60.de>
2021-09-24 16:29:26 +02:00
Jacob Floyd
e34daae0cf
Move cncd/pipeline/pipeline/ to pipeline/ ( #347 )
...
* Refactor: move cncd/pipeline/ to pipeline/
* Refactor: move pipeline/pipeline/ to pipeline/
2021-09-24 13:18:34 +02:00