I are evaluating octopus Deploy and i ran into a situation where a user will input his email into a webpage and upon submit, i have to make a deployment substituting the given email in my project web config file.
I know i can use variables defined on the octopus server, but i need to change them dynamically. I came across your REST api and thought of changing the variables defined in the project but it seems they cannot be accessed directly.
Is there any way to dynamically substitute variables into a web config file?
Thanks for reaching out. You can make the the variable a Prompt Variable so you can manually set the value before each deployment. Not quite “Dynamic”, i know, but you can set the value of this variable dinamically when creating a deployment using
Octo.exe deploy-release with the parameter
--variable which is ideal if you are triggering the deployment from another tool.
Regarding the API approach, it can be done for sure. Let me know if the Octo.exe approach doesnt work for you, and i’ll write you a code snippet showing how to do this from the REST API.
Thanks for the information. I managed to deploy and perform the variable substitution. I also wanted to know if there is a way to know when the deployment has been completed when it is launched from the REST Api.
If you add the parameter
--progress to your call to Octo.exe, it’ll show you the progress of it as it goes, and finally return an exit code depending on its result.
Is this what you need and why you are asking for a way to check it from the REST AIP? Try the
--progress approach and if it doesn’t suit your needs, i’ll write you down some code to check this from the REST api.
Some code on how to check the progress with the REST api would definitely help.
From the REST API you wont be able to get the nice formatted output that you get from Octo.exe or the WebUI. Still, you can get the status of a deployment using this script
Hope that helps