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
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With