1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-07-12 22:21:40 +02:00
Commit Graph

44 Commits

Author SHA1 Message Date
be4ce2e02d Ensure the SharedInformerFactory closes eventually ()
Otherwise it will continue to collect events in the background, consuming memory that can't be GC'd.
2023-02-16 00:54:33 +01:00
18d3139e9e Use modern error handling and enforce it via lint ()
Co-authored-by: Anbraten <anton@ju60.de>
2023-02-02 00:08:02 +01:00
f26a87acce Deduplicate step docker container volumes ()
Try to fix 

It's very hard to reproduce it and only way to fix when it gets in this
state is woodpecker agent restart.

This anyway fixes problem if step mounts and
`WOODPECKER_BACKEND_DOCKER_VOLUMES` conflict
2023-01-31 21:33:40 +01:00
5c617accd8 kubernetes ignore labels and annotations if not set ()
close 
regression of 
2023-01-04 19:51:21 +02:00
1816f6c715 Allow adding additional labels/annotations to kubernetes worker pods ()
Example agent environment configuration using the new value:
```yaml
  - env:
    - name: WOODPECKER_BACKEND
      value: kubernetes
    - name: WOODPECKER_BACKEND_K8S_NAMESPACE
      value: default
    - name: WOODPECKER_BACKEND_K8S_POD_LABELS
      value: '{"sidecar.istio.io/inject":"false"}'
```
2022-12-31 01:37:09 +01:00
f0e518a5a2 Add option to ignore failures on steps ()
closes 
closes  

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
023d03dd61 Spelling ()
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-09 08:12:17 +01:00
e8490a757f GenerateScript should not return encoded script ()
followup to 
2022-11-06 13:36:34 +01:00
e901f605b1 Fix local and ssh backends ()
Base64-encoded string was not decoded.
2022-11-05 14:44:33 +02:00
b15ca52a63 Move constrain to only have a single command in backend to run to dedicated backends ()
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
36e42914fa Renamed procs/jobs to steps in code ()
Renamed `procs` to `steps` in code for the issue 

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
849e05bb8b Rename build to pipeline in code ()
Ref:  

Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: 6543 <6543@obermui.de>
2022-10-18 03:24:12 +02:00
70114ed1fd Fix handling of empty strings for default docker volumes () 2022-09-27 11:43:35 +02:00
2e08dd2333 Add option to set default volumes for docker backend () 2022-09-26 16:59:26 +02:00
9c99406a06 Use archive.org to preserve code comment 2022-09-26 14:52:28 +02:00
3b0263442a Adding initial version of Kubernetes backend ()
Co-authored-by: laszlocph <laszlo@laszlo.cloud>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Rynoxx <rynoxx@grid-servers.net>
2022-09-05 06:01:14 +02:00
9a57602174 Pipeline compiler should not alter specified image ()
* pipeline compiler should not alter specifyed image

adress 
2022-08-26 20:00:11 +02:00
f21d854114 Move away from deprecated go funcs () 2022-08-25 08:39:19 +02:00
4879e922c1 Avoid calling /bin/env in local backend ()
/bin/env was used to resolve a command name against PATH and pass
additional environment variables.
All of this can also be achieved using functionality already provided by
go's exec lib, which will then internally pass the appropriate arguments
to e.g. execve.
2022-07-04 20:27:17 +02:00
061596d802 Gracefully handle non-zero exit code in local backend ()
A non-zero exit code signifies a pipeline failure, but is not a fatal error in the agent.
Since exec reports this as exec.ExitError, this has to be handled explicitly.
This also fixes logs not being shown on build errors.
2022-07-02 15:56:08 +02:00
acbcc53872 Added support for step errors when executing backend ()
When executing a backend step, in case of failure of the specific step, the run is marked as errored but the step error is missing.

Added:
1. Log for the backend error (without trace)
2. Mark the step as errored with exit code 126 (Could not execute).

Co-authored-by: Zav Shotan <zshotan@bloomberg.net>
Co-authored-by: Anton Bracke <anton@ju60.de>
2022-05-11 13:40:44 +02:00
62a1fd8dcb Add support to define a custom docker network and enable docker ipv6 ()
- Add support to define a custom docker network and enable docker ipv6
- Adjust docs
2022-04-29 15:15:32 +02:00
9c6c4559a7 Add SSH backend ()
Add SSH backend that runs commands via SSH.

Close 
2022-04-29 12:30:50 +02:00
16cf59163e Do not ignore failure to clean up the context () 2022-04-07 01:08:04 +02:00
58303dd2a7 Move value of default clone image into shared constant package () 2022-04-06 15:30:49 +02:00
c3788d943f Fix insecure /tmp usage in local backend ()
Since /tmp is writable by everybody, a user could precreate
/tmp/woodpecker with 777 permissions, allowing them to modify the
pipeline while it is being run, or preventing the pipeline from running.

And since os.MkdirAll error code wasn't checked, the same attacker
could have precreated the directory where the pipeline is executed to
mess with the run, allowing code execution under the UID of the
agent (who has access to the toke, to communicate with the server, which
mean a attacker could inject a fake agent, steal credentials, etc)
2022-04-06 03:33:00 +02:00
80c72b590c Add support to run pipelines using a local backend ()
This adds support for . I tested using [this .woodpecker.yml](https://git.exozy.me/Ta180m/Hello-world/src/branch/main/.woodpecker.yml) on my self-hosted [Woodpecker instance](https://ci.exozy.me/Ta180m/Hello-world). I was also able to get this to build [Hugo websites](https://ci.exozy.me/Ta180m/howtuwu/build/1). It's currently very simplistic but works!

close 
2022-03-10 22:07:02 +01:00
e178b7b4b2 Improve agent backend loading and suppress expectable errors ()
* improve agent loop loading backend once

* supress container not found or stopped warnings
2022-03-08 16:21:43 +01:00
3b52afab93 Use DOCKER_HOST env to search for docker before searching for a hardcode docker socket ()
Fix 
2022-02-09 00:08:20 +01:00
be11e57976 Fix avivable -> available typo in backend.go () 2022-01-20 18:21:57 +01:00
03638b2934 pipeline backend: remove unused var () 2022-01-09 23:28:41 +01:00
2f91bdd4a0 gofumpt -w -l -extra . () 2022-01-05 21:50:23 +01:00
680d003a29 Add linter revive ()
* 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
e072e4cce7 Fix pipeline backend autodetect ()
* refactor:
 - rename IsAvivable -> IsAvailable
 - drop depricated Kill
 - make sure backends implement interface
 - rename backend struct for ide (better info)

* docker backend fix autodetect
2021-11-27 02:29:14 +01:00
c1a8884d62 Add backend selection for agent ()
- add backend selection option
- by default it will auto-detect a backend
2021-11-26 03:34:48 +01:00
fac0e16996 Add linter staticcheck ()
* Add linter staticcheck

Co-authored-by: 6543 <6543@obermui.de>
2021-11-25 17:15:36 +01:00
fe31fb1e06 Drop error only on purpose or else report back or log ()
- Remove Deadcode
- Simplify Code
- Drop error only on purpose
2021-11-23 15:36:52 +01:00
4276a04f0c Move entirely to zerolog ()
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
5d8e60808d Move cli exec flags to own file ()
Co-authored-by: Anbraten <anton@ju60.de>
2021-10-03 15:07:39 +02:00
ba0286d055 Remove unused files () 2021-10-02 10:25:26 +02:00
da6fa0ec70 Use moby definitions for docker pipeline backend ()
* Migrate from docker to moby

* moby as interface docker as implementation

* Migrate deprecated func
2021-09-26 21:51:59 +02:00
07d793f727 Migrate go-docker to docker/docker ()
closes 
2021-09-26 14:43:14 +02:00
0bd10fa507 Cleanup Code ()
* 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
e34daae0cf Move cncd/pipeline/pipeline/ to pipeline/ ()
* Refactor: move cncd/pipeline/ to pipeline/

* Refactor: move pipeline/pipeline/ to pipeline/
2021-09-24 13:18:34 +02:00