yml and deployment tab from UI

Lukasz's Avatar

Lukasz

31 Jul, 2017 02:52 PM

Right we are changing all of the our settings in our project directly in UI, but we would like to move part of this settings to the appveyor.yml and store in git like scripts in hooks. I know that is possible but only for all the settings and UI and yml file are not merged together. My question is what is the best approach since we have ~30 deployment slots and right now we are choosing which one to publish from the UI.. and we would like to keep it like that but rest we would like to move to git.

I attached a screenshot how we are choosing on which env we are going to publish (we are using some hacky implementation that we are putting some dumb branch name and then this env is ignored)

Do you have any ideas how we can improve our workflow?

  1. 1 Posted by Ilya Finkelshte... on 31 Jul, 2017 09:17 PM

    Ilya Finkelshteyn's Avatar

    Hope I understood you correctly. And I assume you are using Azure AppService deployment slots.

    I believe that you can achieve this with overriding environment variables feature. Environment variables are one of few settings which are being merged from UI with those set in YAML. Idea is to have single Environment, but provide different site name (and hostname because they are different in case of deployment slot) as environment variables.

    So step by step:

    • create single "master" environment

    • use deployment credentials instead of site credentials (those from publishing profile). Thus you do not have different credentials (and variables) for each slot.

    • add the following variables: siteName and hostName. Note that they are the same for default site, but for slots it is sitename__slotname (2 underscores) and sitename-slotname (single dash) for hostname. Use default values of some non-production site or slot so error to be harmless. Or even non-exiting values.

    • Set up this environment deployment with YAML

    deploy:
    - provider: Environment
      name: ilyaf4
      siteName: $(siteName)
      hostName: $(hostName)
    
    • Add variables: siteName and hostName into UI.

    Now you can always change slot by altering those variables in the UI, while having build configuration in YAML.

  2. 2 Posted by Ilya Finkelshte... on 31 Jul, 2017 09:22 PM

    Ilya Finkelshteyn's Avatar

    Better project UI screenshot

  3. 3 Posted by Lukasz on 31 Jul, 2017 10:04 PM

    Lukasz's Avatar

    No they are not slots, we are always publishing to test slot (we have test, staging, prod) but our service is in multiple countries (so what I showed in the first screen are test env for each country) so we need to be able to choose to which countries we are going to deploy particular version. So for example we have country A, B ,C, D, E and we should be able to deploy only to countries we want for example A and D.

  4. 4 Posted by Ilya Finkelshte... on 01 Aug, 2017 12:02 AM

    Ilya Finkelshteyn's Avatar

    So it is not always 1 of 5 countries, but can be say 2 or 3 of them?

  5. 5 Posted by Ilya Finkelshte... on 01 Aug, 2017 01:50 AM

    Ilya Finkelshteyn's Avatar

    You can do something like this:

    deploy:
    - provider: Environment
      name: Env-A
      on:
        deploy_a: true
    - provider: Environment
      name: Env-B
      on:
        deploy_b: true
    ...
    - provider: Environment
      name: Env-E
      on:
        deploy_e: true
    

    and manage values for environment variables deploy_a, deploy_b, ... deploy_e with UI.

  6. 6 Posted by Lukasz on 01 Aug, 2017 07:17 AM

    Lukasz's Avatar

    that sound good, and how I'll actually deploy based on this variables?

  7. 7 Posted by Ilya Finkelshte... on 01 Aug, 2017 02:58 PM

    Ilya Finkelshteyn's Avatar

    The similar way as you do now. As I understand that now you go and manually set BranchThatDoNotExistWillNotPublishThere. With this configuration you will go to Settings > Environment in UI and set appropriate values for those variables. So you will be able to change what country to deploy with UI, while having rest of build configuration in YAML.

  8. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:18 AM.

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

Recent Discussions

18 Jun, 2025 08:45 PM
18 Jun, 2025 04:23 PM
13 Jun, 2025 04:36 PM
13 Jun, 2025 04:27 PM
13 Jun, 2025 07:20 AM

 

10 Jun, 2025 01:56 AM
09 Jun, 2025 07:11 PM
04 Jun, 2025 04:08 PM
27 May, 2025 05:48 PM
27 May, 2025 06:37 AM
27 May, 2025 06:31 AM