Copied to clipboard

Flag this post as spam?

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


  • Paul Gower 28 posts 74 karma points
    Dec 22, 2016 @ 15:19
    Paul Gower
    0

    Config scheduledTasks across multiple environments

    What is the best way to configure a scheduled task so it will run in whichever environment the website is published to?

    I would like to check in a version that works for the DEV environment but I don't want the umbracoSettings.config to be overridden in STAGE by this version when I publish.

    Today, we manually publish from VS2015 but next year our plan is to publish in a more automated fashion with a CI/CD pipeline. So although I could manually change it in each environment and update the url to be specific to each environment I don't want to do it manually.

    I'm trying to determine how best to solve it for today but with an eye for the future when we have it more automated.

    Here is an example of the scheduledTask I am using today:

    <task log="true" alias="trialAccountBackgroundTask" interval="85000" url="http://localhost:62891/umbraco/surface/FreeTrialSurface/TrialAccountBackgroundTask"/>
    

    I would like to either use relative paths for the URLs or replace localhost:62891 with a token that is replaced for each environment.

    Thoughts?

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Dec 29, 2016 @ 12:05
    Dave Woestenborghs
    0

    Hi Paul,

    We use config transforms for this using the Slow Cheetah plugin for visual studio.

    You will need to have different build configs for all your environments.

    So when you build for Live, the live transform will be applied to the config file.

    dave

Please Sign in or register to post replies

Write your reply to:

Draft