Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multi-pipeline with cli exec #443

Closed
3 tasks done
anbraten opened this issue Oct 13, 2021 · 3 comments · Fixed by #568
Closed
3 tasks done

support multi-pipeline with cli exec #443

anbraten opened this issue Oct 13, 2021 · 3 comments · Fixed by #568
Assignees
Labels
cli feature add new functionality
Milestone

Comments

@anbraten
Copy link
Member

anbraten commented Oct 13, 2021

Clear and concise description of the problem

There currently is no support for woodpecker-cli to run multiple pipeline files as the agent is able to do.

Suggested solution

Running woodpecker-cli exec ./.woodpecker/ should detect that the path is a folder and run all pipelines as the agent would do.
Somehow similar to how woodpecker-cli lint works.

Alternative

No response

Additional context

No response

Validations

@anbraten anbraten added feature add new functionality cli labels Oct 13, 2021
@Bubu
Copy link

Bubu commented Oct 13, 2021

Would it be possible to (optionally) just run a single pipeline? I.e. I would for example like to run just woodpecker-cli exec lint.

@6543
Copy link
Member

6543 commented Oct 13, 2021

nice idear ...

@6543 6543 added this to the 0.15.0 milestone Oct 13, 2021
@6543 6543 self-assigned this Oct 13, 2021
@anbraten
Copy link
Member Author

I would do it by checking the file/dir type as we do it with lint. For folders run all files and if you call it with a single file just run that file.

        file := c.Args().First()
	if file == "" {
		file = ".woodpecker.yml"
	}

	fi, err := os.Stat(file)
	if err != nil {
		return err
	}
	if !fi.IsDir() {
		return lintFile(file)
	}

@6543 6543 closed this as completed in #568 Dec 13, 2021
6543 added a commit that referenced this issue Dec 13, 2021
close #443

* add support to exec
* auto detect multi-pipeline for lint and exec
* de-duplicate code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli feature add new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants