woodpecker-ci / woodpecker

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

`woodpecker exec .woodpecker/ubuntu.yml` has no repo available #2511

Open wez opened 1 year ago

wez commented 1 year ago

Component

cli

Describe the bug

Running a pipeline directly like this:

$ woodpecker exec .woodpecker/ubuntu.yml
...
[build:L188:17s] + ./get-deps.sh
[build:L189:17s] /bin/sh: 30: ./get-deps.sh: not found

fails to mount the repo, so fails to run the get-deps.sh script that is present in the repo.

However, running it like this:

$ woodpecker exec .
# ci.yml

# ci.yml

# rust.yml

# ci.yml

# ci.yml

# ci.yml

# ci.yml

# ci.yml

# codecov.yml

# audit.yaml

# benchmarks.yaml

# coverage.yaml

# test.yaml

# ci.yml

# FUNDING.yml
...

worryingly enumerates all the various yaml files in my working copy (those shown are from misc .cache and .github directories) as shown above, as if it were trying to run those, but does mount the repo and is able to run the script from inside it.

My expectation is that I can specify the pipeline I want to run based on the --help output:

$ woodpecker exec --help
...
USAGE:
   woodpecker-cli exec [command options] [path/to/.woodpecker.yaml]

and have the repo mounted in the pipeline at the same time.

System Info

$ woodpecker --version
woodpecker-cli version 1.0.2

Additional context

No response

Validations

wez commented 1 year ago

If I can be frank, the docs for the CLI are particularly light on meaningful detail. While they appear to have a list of all of the possible options but there is no explanation for anything. I only found the exec . thing by reading through the issues on github. It would be great to have a getting started section that shows how best to use exec!

My goal in this situation is to build up my pipelines without making dozens of pushes to dial things in.

qwerty287 commented 11 months ago

What do you would like to change? Would just more documentation be enough?

wez commented 11 months ago

my perception is that this command doesn't work as advertised by its help; the repo needs to be mounted in the first case.

In the second case, I would like some other way to scope the workflow that is being run, and not have woodpecker look through random directories