Schedule release using TFS


(dan.hoenig) #1

I setup TFS 2017 to build and deploy my app using Octo. I used the Octo created tasks in TFS to package, publish the packages to octo and create/deply the app. Everything works really good. Now I’d like to have it do this but instead of deploying the app immediately I’d like it to schedule the deployment. I can get it to work by adding the “deployAt” option to the “Create Octopus Release” task. But, the problem is I can only seem to put a static datetime in. I’d like this to take the current date and add one day to it. Is there a way to do this?

(Shaun Marx) #4

Hi Dan, thanks for getting in touch.

You are not limited to static dates for the argument as you can use variables as provided by VSTS/TFS. I don’t think the fields themselves support expressions, but you can definitely create the variable as part of another step.

You should be able to set the output variable using something like the following:

$releaseDate= ([System.DateTimeOffset]::Now).AddDays(1).ToString()
Write-Host "##vso[task.setvariable variable=releaseDate]$releaseDate"

You can then user the variable in the additional arguments field of the Octopus create release task similar to any other variable:


Hope that helps!

Shaun Marx