Update .js file variables

jagruti.chavan.1892's Avatar

jagruti.chavan.1892

23 Jan, 2018 11:49 AM

ServerUrl = {
hostname:"https:\localhost..."
}

I want to update the value of hostname here...how can I do that.
Thanks in advance.

  1. Support Staff 1 Posted by Kenneth Bates on 24 Jan, 2018 01:09 AM

    Kenneth Bates's Avatar

    Hi Jagruti,

    Thanks for getting in touch! You can definitely substitute values like this during your deployment process. This would be done by enabling the Substitute variables in files feature, which can substitute matching variables' values into any text file. You would need to use the following substitution syntax in your .js file: #{VariableName}. You can read more information about this feature in our documentation.
    https://octopus.com/docs/deployment-process/substitute-variables-in...

    From there, you can create multiple project variables, all with the same name, but different values and scopes to dynamically change which value is substituted depending on where you're deploying to. :)

    I hope this helps! Don't hesitate to reach out if you have any further questions going forward!

    Best regards,

    Kenny

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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