Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TeamCity Call Url Build Step

I am using TeamCity to build and deploy files onto a IIS website using Web Deploy 3.

I would like to add a step to call a url when done so that the custom cache can be refreshed when the deployment is finished.

Is there a way I can add a build step to call a url?

Thanks

like image 365
Base33 Avatar asked Jan 14 '13 10:01

Base33


People also ask

How do you set building steps in TeamCity?

In Build Steps, click Auto-detect build steps, and then select the proposed steps you want to add to the current build configuration. You can change their settings afterwards. When scanning the repository, TeamCity progressively searches for project files on the two highest levels of the source tree.

How do I run a build on TeamCity?

To run a custom build with specific changes, open the build results page, go to the Changes tab, expand the required change, click the Run build with this change, and proceed with the options in the Run Custom Build dialog. Use HTTP request or REST API request to TeamCity to trigger a build.

How do I make a TeamCity build?

Go to Administration | Projects and open the required project. Alternatively, open the project using the Projects pop-up menu and click Edit Project Settings. The Project Settings page will open. On the Project Settings page, click Create build configuration under the Build Configurations section.


1 Answers

A newer, cleaner, just-as-simple method would be also using Powershell:

wget "http://yourwebapp.net"

wget is an alias for Invoke-WebRequest, supporting more options like settings the request timeout.

Full docs: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-6

NB: On older environments you may want to set -UseBasicParsing to prevent parsing errors.

like image 191
Robert Sirre Avatar answered Oct 28 '22 14:10

Robert Sirre