johanclasson / vso-agent-tasks

Build and Release Tasks for Visual Studio Online and Team Foundation Server
MIT License
20 stars 16 forks source link

How can I test the task locally #70

Closed Liero closed 3 years ago

Liero commented 3 years ago

I'm curious whether I can run the generated command locally on my dev machine?

johanclasson commented 3 years ago

Sure.

Download this directory and invoke the script like this:

. .\Update-DatabaseWithDbUp.ps1
Update-DatabaseWithDbUp `
    -ConnectionString $connectionString `
    -ScriptPath $scriptPath `
    -Journal $journal `
    -JournalSchemaName $journalSchemaName `
    -JournalTableName $journalTableName `
    -Filter $scriptFileFilter `
    -Encoding $encoding `
    -TransactionStrategy $transactionStrategy `
    -Logging $logging `
    -SearchMode $searchMode `
    -Order $order `
    -VariableSubstitution $variableSubstitution `
    -VariableSubstitutionPrefix $variableSubstitutionPrefix

Check the parameters of Update-DatabaseWithDbUp. Some have default values and some only accept enum input.

johanclasson commented 3 years ago

If you are after a way of executing a DevOps pipeline locally, I am afraid that this is not possible.

But I made a fast search on google, and apparently there seams to be a preview feature which lets you install an agent locally and have it invoke the pipeline using a "local mode".

johanclasson commented 3 years ago

Closing due to inactivity. Please open if this is still an issue.