continuous-integrationazure-devopsoctopus

CI for hotswapping non-compiled files into VSO and Octopus pipeline


Context:

Currently we manually get a git dev branch built into a package into VSO, and once that package is built it deploys to Octopus and takes down the site for a good amount of time as all the built packages are loaded into each server the site sits on... But, honestly, a lot of the bug fixes end up being in js files that could easily just be hot swapped in... and it's just so annoying to have to wait for poor OPs and support to do all of this just for a teensy tiny change.

The pipedream:

I would like to set up CI that allows hot swapping of js,css,cshtml,html files to VSO and Octopus... This will allow small petty changes in javascript files to be issued out fast and without deployments...

...and also have another option that allows me to say, "look, i've changed some csharp files so i need a built package to be pushed up into VSO and Octopus". A manual rebuild if you will.

Question:

I'm missing the vocabulary to search for this in Google and wondered if you guys can help me on a path to setting this up.


Solution

  • You can just include the modified files (remain folder structure) in the package, then push this package to Octopus server and deploy with this package, then the necessary files will be replaced.

    My workflow of IIS deploy:

    1. New Deployment Target with Listening tentacle mode
    2. Add Deploy to IIS process template for Octopus project
    3. Enable Custom installation directory feature in Configure Features window of Process
    4. Specify Custom Install Directory path in process

    Build tasks:

    1. Add Copy Files task to copy necessary files (e.g. js)
    2. Add Package Application task to package these files (remain folder structure)
    3. Add Push Packages to Octopus task
    4. Add Create Octopus Release task

    On the other hand, you can include all published files to package (tested with File System publish), then deploy with that package, the Octopus can compare files and just replace the modified files ({webapp}.dll will be replaced too, checked the Created, Modified time on target server)

    Regarding get changed files during build, you can call Get commit with Changed items REST API, then create/modify the build variable (e.g. depAll) through Logging Command (e.g. PS: Write-Host "##vso[task.setvariable variable=depAll];]Yes") per to the changed files result, then using this variable in task condition (Control Options of each task) to determine which tasks need to be run. Specify conditions for running a task