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

Discussion: Version with loosened dependencies? #12

Open
JustinGrote opened this issue Nov 21, 2018 · 1 comment
Open

Discussion: Version with loosened dependencies? #12

JustinGrote opened this issue Nov 21, 2018 · 1 comment

Comments

@JustinGrote
Copy link
Contributor

JustinGrote commented Nov 21, 2018

Since this is aiming to be a "library" of tasks and a framework to use for opinionated templates, perhaps some of the dependency ordering should be loosened?

For instance, maybe I don't want Publish to depend on Test, or maybe I don't want Test to be dependent on Pester because I want to use my own testing framework.

I was thinking of a variable(s?) to make these dependencies conditional. The dependencies would be on by default, but you could set the variable that would effectively remove all the dependencies and then you can pick-and-choose the tasks/jobs and assign dependencies as required in the downstream template.

This would be an "at-your-own-risk" item, but also should probably focus on individual tasks also being autonomous and not being "truly" dependent on each other (e.g. won't fail if a dependency isn't met)

For tasks that require interoperation, could define high level tasks like "Build", "Test", "Publish" but those are just empty tasks with dependencies, so that those could be overridden in the script.

@devblackops
Copy link
Member

@JustinGrote I was thinking the same thing. We can define default dependencies via $PSBPreference properties and allow the user to modify those if needed.

Default Publish task dependency in build.properties.ps1

$PSBPreference.TaskDependencies.Publish = 'Test'

psakeFile.ps1

task Publish -depends $PSBPreference.TaskDependencies.Publish {
    ...
}

Override Publish task dependency in your psakeFile.ps1

$PSBPreference.TaskDependencies.Publish = 'MyOwnTest'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants