Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thobias 14 posts 104 karma points
    Feb 09, 2017 @ 09:51
    Thobias
    0

    Install package automatically after deployment

    Hey,

    we are preparing our development/deployment process. In order to a nightly build we want to update templates and some content paths after a deployment automatically.

    Updating file system is no problem and already running.

    Is there any best practice to do this? Cant find any out of the box solution.

    Thanks Thobias

  • Thobias 14 posts 104 karma points
    Feb 09, 2017 @ 12:52
    Thobias
    0

    Solved.

    For anyone who want to know how:

    1. Take a look here: https://our.umbraco.org/projects/developer-tools/umport

    2. Install via Umbraco Package Dialog on local and deployed Umbraco environment.

    3. Configure *.config like the description in mentioned.

    4. Check generated xml files into your repository

    5. Build your project and publish the generated xml files from point 4 with your CI

    6. Add a new deployment step to send a post request. For me its a powershell script. eg.:

    param (
       [String]$url=$(throw "url must be specified."),
       [String]$apikey=$(throw "apikey must be specified.")
    )
    
    $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
    $headers.Add("Accept", 'application/json')
    
    $JSON = @{
      dataTypes = "CUD"
      templates = "CUD"
      documentTypes = "CUD"
      macros = "CUD"
      mediaTypes = "CUD"
      memberTypes= "CUD"
      memberGroups = "CUD"
      languages = "CUD"
      dictionaryItems = "CUD"
    }
    
    $uri = "$url/umbraco/api/umport/import?apiKey=$apikey"
    
    Write-Host "POST Request send to:         $uri"
    Write-Host "POST Data:                    $JSON"
    
    
    Invoke-WebRequest -uri "$uri" -Headers $headers -Method POST  -Body $JSON -usebasicparsing
    

    Powerhell script can placed in repository too. With params you can control the url and apikey within deployment process. The "-usebasicparsing" is important when you want to run this on a VisualStudio Teams deployment process.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies