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

DependingOn not working as expected (ordering wrong) #101

Open
csandfeld opened this issue Sep 27, 2017 · 5 comments
Open

DependingOn not working as expected (ordering wrong) #101

csandfeld opened this issue Sep 27, 2017 · 5 comments

Comments

@csandfeld
Copy link
Contributor

Using DependingOn results in a deployment order that is completely different from what I expected.

Consider the following psdeploy.ps1 file:

Deploy A {

    By Task Setup {
        FromSource {
            'Setup'
        }
    }

    By Task One {
        FromSource {
            'One'
        }
        DependingOn Setup
    }

    By Task Three {
        FromSource {
            'Three'
        }
        DependingOn Two
    }

    By Task Five {
        FromSource {
            'Five'
        }
        DependingOn Four
    }

    By Task Four {
        FromSource {
            'Four'
        }
        DependingOn Three
    }

    By Task Two {
        FromSource {
            'Two'
        }
        DependingOn One
    }

    By Task Teardown {
        FromSource {
            'Teardown'
        }
        DependingOn One, Two, Three, Four, Five
    }

}

I would expect the order of execution to be:

  • Setup
  • One
  • Two
  • Three
  • Four
  • Five
  • Teardown

But what I get is:

C:\test> Get-PSDeployment -Path .\test.dependencies.psdeploy.ps1 | Select DeploymentName

DeploymentName
--------------
A-Five
A-One
A-Three
A-Two
A-Four
A-Teardown
A-Setup
C:\test> Invoke-PSDeploy -Path .\test.dependencies.psdeploy.ps1 -Force
Five
One
Three
Two
Four
Teardown
Setup

Version used:

C:\test> Get-Module PSDeploy

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.2.1      PSDeploy                            {By, DependingOn, Deploy, FromSource...}
@RamblingCookieMonster
Copy link
Owner

Hiyo!

So it looks like we namespace the dependency name - try using A-One, A-Two and so forth as the items you are depending on.

I don't recall the specifics, but I think it was to avoid collisions. I might need to update docs, there's some info here, but at a quick glance didn't see in module docs.

Also, in that example... not sure why B wasn't namespaced. Will have to look at the code, might take a few days

Let me know how it turns out with the namespaced DependingOn bits!

Cheers!

@csandfeld
Copy link
Contributor Author

Yup - using namespaced names works - thank you for your speedy reply

@csandfeld
Copy link
Contributor Author

On another note ... is there a way to setup a task, to only run if specific tasks are used?
In other words, if Invoke-PSDeploy is invoked without specifying the tag, the task does not run.

@RamblingCookieMonster
Copy link
Owner

Hi! Completely missed the follow-up, sorry about that!

Can you give a quick pseudocode example that you might expect to use if this was in place? Just the ability to use tags for Task deployment types? Just flipped through the code, and I explicitly avoided this for some reason - if you have any ideas on how to implement it, seems like it would handy!

@csandfeld
Copy link
Contributor Author

No worries, and sorry for the late reply. Racking my brain to try and remember what that was all about, but comming up short.

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