locked
How much persistent are files in case of continuous deployment RRS feed

  • Question

  • My goal is to install WordPress ina folder of my .Net App continuously deployed via bitbucket.

    So far I put the installation files of WP in the folder in my local solution and push them in the repo. The doubts are:

    1. as WP updates and creates new files (config, plugin, themes etc) should I download the folder from the deployed version and include the files in the repo everytime WP config/plugins/themes are updated? I doesn't look as an ideal solution.

    2. if I file exist in both the repo and in the filesystem on azure and the one in the repo is older what happens at the next deploy? Who wins? The (older) in the repo or the (newer) already deployed? I'm thinking, for example, to wp-config.php

    3. if I file doesn't exit in the repo but does exist in the filesystem on azure, who wins and the next deploy? I'm thinking, for example, to plugins, themes etc.

    If the answers to 2 and 3 are both that the files on the filesystem on azure wins, is there any reason to include WP in the repo at all? Probably it is better to copy WP via FTP the first time and that's all.
    At that point, how much persistent are files on the filesystem? Do they survice stop/start/scale/plan change/etc of the web app?
    I'm a bit nervous to have files, config etc only on azure filesystem and not in the repo but I can't see how I could easily keep the repo updated with the changes that happens "live" on WP.

    Thursday, March 31, 2016 8:40 AM

All replies

  • Here are some replies to your questions:

    1. No, that's not a good workflow indeed
    2. If the file exists in the repo, it will always win over the current file, regardless of old/new.
    3. If it's not in the repo, then the deployment process will leave it alone


    So the wisdom is: don't include in your repo any files that may get modified at runtime, as you would lose those changes. Only include core files which don't change at runtime.

    thanks,
    David

    • Proposed as answer by David Ebbo Thursday, March 31, 2016 4:07 PM
    Thursday, March 31, 2016 4:07 PM
  • Thanks David, everything is much clearer now and I'll follow your suggestion. I still have a doubt about my last question:

    How much persistent are files on the filesystem? Do they survive stop/start/scale/plan change/etc of the web app?
    I'm a bit nervous to have files, config etc only on azure filesystem and not in the repo so I'd like to fully understand in which cases they could be lost.

    Also: deployment slots. What is the best practice to handle these? If WP updates something on slot A and then I swap to B, B will not have these changes obviously...

    Friday, April 1, 2016 6:50 AM
  • All the files under d:\home are completely persistent, regardless of scaling/restart/etc...

    Deployment slots are tricky to use in scenarios where the runtime adds new files. They are more design for when the deployment brings in all the files, and the files don't change at runtime.

    Friday, April 1, 2016 7:23 PM