Update a config value set in a prior step

joneil's Avatar

joneil

16 May, 2017 05:31 PM

Hi,

A project that I am updating has a true/false flag app setting in my web.config file that is used to indicate that the website is down for maintenance. After we verify that everything is running as expected, I would like to flip this flag in the web.config file. Is this possible?

I tried setting up a "Manual Intervention" step and I set the variable scope to that step role. However the value that I want to update is in a web.config file that was deployed in a prior step. Is there a way to update a file already deployed?

Thanks,
John

  1. Support Staff 1 Posted by Pawel Pabich on 17 May, 2017 01:43 AM

    Pawel Pabich's Avatar

    Hi John,

    Thanks for getting in touch! I think you are on the right track.

    Your deployment process can look like this:

    1. Step1 deploys application and flips the flag to false
    2. Step2 (Manual Intervention) stops the deployment so it can be verified
    3. Step3 (Run a Script) uses an output variable
      Octopus.Action[Step1].Output.Package.InstallationDirectoryPath to locate the web.config and flips the flag to true

    Please let me know how you go.

    Regards,

    Pawel

  2. 2 Posted by joneil on 17 May, 2017 09:36 PM

    joneil's Avatar

    Hi Pawel,

    I started to build a script step to what you suggested after the Manual Intervention step. However I decided to just duplicate the earlier website deployment step and add a new variable scoped to that process step number. This way I don’t have to maintain any custom script code.

    Thanks for your help
    John

  3. Support Staff 3 Posted by Pawel Pabich on 17 May, 2017 10:11 PM

    Pawel Pabich's Avatar

    Hi John,

    Thanks for letting me know. Great idea!

    Regards,

    Pawel

  4. Paul Stovell closed this discussion on 23 Aug, 2017 03:48 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac