Selecting package name by using a variable

Jonas Hilmersson's Avatar

Jonas Hilmersson

14 Nov, 2017 03:59 PM

Hi,

I have packages that are named ClientName.Application.1.2.3 and have a separat track for packages named ClientName.Application-Develop.0.0.x to be installed into a certain TEST environment. I've tried to setup a variable 'packageName' containing different values per environment but OD doesn't find any packages when I specify the TEST environment. I've also tried to setup a channel for TEST that specifies another package name in a variable and with version restriction (,0.0) to only get the ClientName.Application-Develop.0.0.x packages, but it still doesn't work.

I'm using Octopus v3.3.6.

Any tips?

Brgds

Jonas

  1. Support Staff 1 Posted by Kenneth Bates on 15 Nov, 2017 01:03 AM

    Kenneth Bates's Avatar

    Hi Jonas,

    Thanks for getting in touch. I suspect the issue could be that your package ID isn't able to be resolved at release creation. In addition to your 2 environment-scoped packageName variables, could you try creating a new unscoped variable with the value ClientName.Application (which I assume is the package name intended for your DEV environment)? This should get your scoped variables to evaluate to the correct package name for each environment.

    Let me know how you go and if this works!

    Kind regards,

    Kenny

  2. 2 Posted by Jonas Hilmersso... on 15 Nov, 2017 05:59 AM

    Jonas Hilmersson's Avatar

    Hi,

    So there should be three different values, one without any scope, one for TEST and one for PROD?

    Brgds

    Jonas

    Enviado desde mi smartphone Sony Xperia™

    ---- Kenneth Bates escribió ----

  3. Support Staff 3 Posted by Kenneth Bates on 16 Nov, 2017 12:57 AM

    Kenneth Bates's Avatar

    Hi Jonas,

    Thanks for following up. The unscoped variable is required for the package ID to be resolved at release creation time. The environment scoped variable will resolve when deploying to that environment. So if you have two environments (TEST and PROD), you can do this with only two variables:

    1) Unscoped variable with value of package ID for your TEST environment (ClientName.Application-Develop)
    2) PROD-scoped variable with value of package ID for your PROD environment (ClientName.Application)

    You can have one scoped to TEST as well, but that one isn't necessary if that's the first environment in your lifecycle, as it should automatically resolve to the value of the unscoped variable.

    I hope that helps! Let me know how you go with testing this and if you have any further questions. :)

    Best regards,

    Kenny

  4. 4 Posted by Jonas Hilmersso... on 16 Nov, 2017 09:18 AM

    Jonas Hilmersson's Avatar

    Hi,

    I got it to work now, I used the unscoped variable value as you suggested, and then I also needed to not only scope the variables with the environment but with the channel to get it to work.

    Mvh / Brgds

    Jonas

  5. Support Staff 5 Posted by Kenneth Bates on 17 Nov, 2017 01:32 AM

    Kenneth Bates's Avatar

    Hi Jonas,

    That's great to hear you go it working! Thanks for letting me know. Don't hesitate to reach out if you have any further questions going forward. :)

    Kind 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