uat and production builds

ismail.mayat's Avatar

ismail.mayat

19 Mar, 2019 03:24 PM

I have 2 projects setup and each of those projects has 2 environments a live and uat. I do run a build then deploy uat that works fine and my config transforms for uat are applied.

For live when i deploy it seems to be picking up the uat artifact and uat configs? I guess I am doing something wrong? My yaml file looks like

#uat configuration
-
  branches:
    only:
      - master
      
  #version format
  version: 1.0.{build}

  configuration: UAT
  
  cache:
    - packages -> **\packages.config
    
  before_build:
    - nuget restore
    - npm install -g grunt-cli
    - cd mysite.Web.UI
    - set PATH=C:\Ruby22\bin;%PATH%
    - gem install compass
    - npm install
    - grunt prod
  
  build:
    publish_wap: true
    project: mysite.sln

  deploy:
    provider: Environment
    name: UAT Main Site
    app_offline: true
    skip_dirs: \\App_Data
       
#live configuration
-
  branches:
     only:
       - master
      
  #version format
  version: 1.0.{build}

  configuration: Live

  cache:
    - packages -> **\packages.config
    
  before_build:
    - nuget restore
    - npm install -g grunt-cli
    - cd mysite.Web.UI
    - set PATH=C:\Ruby22\bin;%PATH%
    - gem install compass
    - npm install
    - grunt prod
  
  build:
    publish_wap: true
    project: mysite.sln

is it because for live i do not have deploy which I run manually?

  1. Support Staff 1 Posted by Owen McDonnell on 19 Mar, 2019 06:18 PM

    Owen McDonnell's Avatar

    I see that you are using conditional build configuration but both conditions are the same.
    i.e.

      branches: 
         only: 
           - master
    
    I haven't addressed your deployment problem since this stood out to me first as a possible mistake.
  2. 2 Posted by ismail.mayat on 20 Mar, 2019 08:51 AM

    ismail.mayat's Avatar

    Owen,
    So I am going to update the uat part to

      branches:
        only:
          - uat

    so it will now use different branch.

    At the project level in settings default branch has been set to master and branches to build has been set to all (nb have inherited this, first time using app veyor, have experience with teamcity and octopus).

    When i run the build which is at project level am i right in assuming it creates the artifact based on master which is default branch. Then when deploy is run for the different environments will it use the yaml file settings to transform for the different environments? Still trying to get my head round how it all ties together.

    Regards

    Ismail

  3. Support Staff 3 Posted by Owen McDonnell on 21 Mar, 2019 01:47 AM

    Owen McDonnell's Avatar

    I'm not exactly sure of your question but you may wan to give this a quick read.
    By project level you mean when you start a build from the UI? If so, yes, default branch will be built, and the part of your config under

      branches: 
         only: 
           - master
    
    will be used.
  4. 4 Posted by ismail.mayat on 22 Mar, 2019 11:00 AM

    ismail.mayat's Avatar

    Owen,

    Ok mystery solved. So first issue was as you rightly pointed out i was looking at wrong branch for uat. The other issue was my bitbucket was missing the webhook url from appveyor. Once i added that any commits to uat and i get auto build and deploy. Commits to master and i get build, deploy is manual as expected.

    Many thanks for your help.

    Regards

    Ismail

  5. ismail.mayat closed this discussion on 22 Mar, 2019 11:00 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

 

01 Oct, 2024 04:27 PM
26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM