woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.1k stars 354 forks source link

Pin a pipeline to an specific agent #740

Closed 6543 closed 2 years ago

6543 commented 2 years ago

workaround could be done with set a "custom" platform, but since #690 it's autodetected ...

the idea is to use the "agent labels" as filter but they do not work?

https://github.com/woodpecker-ci/woodpecker/blob/2f91bdd4a0f5167ef304c220865141c15f2dd563/cmd/agent/agent.go#L39-L44 ...

anbraten commented 2 years ago

304

6543 commented 2 years ago

hmm could be a dublicate ... depending on if they can be used for this kind of feature ... - I need to test them and they need a good documentation!

anbraten commented 2 years ago

We probably need to refactor them a bit. I would like to have something like a tag property for whole pipelines & pipeline steps and something similar for agents. So it should be possible to

s00500 commented 2 years ago

Hm.... so this does work, I could add a filter to an agent like this:

WOODPECKER_FILTER="mysyslabel == 'mylabeledrunner'"

Then I can specify labels in the root of the yaml file like

pipelines:
  ...
labels:
  mysyslabel: mylabeledrunner

from the logic I can also see that the condition would be able to filter on "repo" and "platform"... But as pointed out in the older issue the normal platform check is skipped when a filter condition is active on an agent

anbraten commented 2 years ago

We introduced those agent labels which can be used for tagging in #902