Web deploy non purge directory not working

Hello,
A few questions in my testing. Question 1. I am testing deploy Windows web instance to custom directory, UNCHECKED box “Purge this directory before install”. But deploy result still purged everything. We only want to deploy runnable contents and need to retain other contents like images etc. This is important for us. Is it doable? How to achieve that? Any command that work more reliable than GUI settings?

Question 2: in https binding - IP address, our web farm have dozen servers, each of those instance has its own IP that is configured for F5 load balance. We can’t use *, or one IP for whole farm. Is there proper way to configure it so the deploy can keep IP binding intact?

Question 3: is there any way to force the process NOT doing app pool part? we have large web farm, servers have multiple apps/IP, each deploy it check app pools, that looks quite costly and unsafe. Is there command to take out that step? The GUI appear no way to do that.

Question 4: is there any way to configure IIS child web application for specific authentication options? I saw IIS instance have that option. But some of our child web app also use their own authentication currently. In GUI, I can’t find way to configure it.

Thanks in advance for your help!

Hi @jhu,

Thanks for reaching out.

Question 1 seems like unintentional behavior. Which version of Octopus are you currently running? Would you be able to private message me a deployment process JSON(To get this go to the Project, then the process section, then click the 3 dots to the right of add step and click download JSON) as well as a task log where it purges the whole folder? Please let me know the name of the step if possible.

Question 2-4: If we can solve question 1, we may be able to use a Deploy a Package step to avoid a lot of the IIS configuration, then leverage some of the IIS library step templates to configure what you need. To look at the steps templates we have available, go to Library->Step Templates->Browse Library.

Please let me know what you think.

Thanks,
Jeremy

Hi Jeremy,

Thanks for getting back to me. My Octopus Deploy Server version is 2020.2.11. Tentacle version is 5.0.14.

When I tried to download JSON, clicked that but nothing happened. I am not sure that related to my previous step. I did a step further, clicked in Process and clicked 3 dots next to Save and then clicked Distract Template. How can I roll back that step? It only show as “Detach Step Template” now.

the step name is “Custom Install Directory”

I attached log here. Hope you can help me figure out the JSON download thing.

Thank you!
John

ServerTasks-1687.log.txt (12.6 KB)

Hi John,

Thanks for all the information. Are you using Chrome? Could you try using Firefox and see if it allows you to download the JSON? If that doesn’t work I will try to reproduce without it.

Thanks,
Jeremy

Hi Jeremy,

I just realized it’s browser related. Now tried Edge and able to download it. Here attached the JSON file. Thank you!

John

proj-testweb-process.json (4.15 KB)

Hey John,

I reproduced your setup on 2020.2.11. I noticed that there are some remnants of settings when you had it set to purge the directory except for web.config. I reproduced that on my end as well so that my deployment process also has that remnant. I did that by enabling purge, setting it to exclude web.config saving the step, then disabling the purge(without removing the entry to exclude web.config) and saving again. I can’t seem to get it to purge the directory with the setting toggled off. Is there something else in your setup I haven’t accounted for?

Sorry for the newbie question, but did you at one point have it enabled, changed it to disabled, and haven’t created a new release and are re-deploying an old release?

Thanks,
Jeremy

Hi Jeremy,

Thanks for indicating the release trick. I created a new release and it did non purge and excluding web.config files as expected! Much appreciated!

Now could we talk a little more on your suggestions on question 2-4? Is there documentations I can start with or build in package I can try out? Thanks!

John

Hi John,

You’re very welcome. I’m glad to hear it’s working now. Just to explain a bit further, releases are snapshots in time and can’t be updated to reflect steps that have been modified. You’ll always need to create a new release if you’ve modified the process in some way and want to run that new process. You CAN however update the variables in a snapshot with the Update Variables button on a release page.

For questions 2-4, I believe now that we have the first problem solved the way we will want to go is for you to manually deploy the IIS content with Deploy a Package, and then you will do all of your IIS configuration independently of the Default IIS Step(you won’t use this at all), and the Deploy a Package step. We have a bunch of step templates you can take a look at to see if they will fit your needs.

To explain a bit more, I don’t think you will be able to use our Default IIS step as its a very “cookie-cutter” scenario that fits 90% of use cases. The rest of our customers that fall out of that “cookie-cutter” scenario will have to do their IIS configuration/modification either manually in script steps, or with our step templates.

Can you take a look at the step templates we have available by going to Library->Step Templates->Browse Library? All/A lot of the work may already be done for you in those steps.

Please let me know if you think that will work, or if you need more assistance with it.

Thanks,
Jeremy

that’s the way I figured, so now add a new release for each test.

For Template, it seems I don’t have any, Did I miss something in installation?

Hey John,

I took a couple screenshots for you:

Does that work for you?

Thanks,
Jeremy

I did exact steps, but just empty as my screenshot show. that’s why I felt maybe I missed something in my installation?

Is there anywhere I can go download the templates?

Hey John,

Can you check and see if it’s disabled on your setup?

To do that go to Configuration -> Features and make sure Community Step Templates is enabled.

Thanks,
Jeremy

I find it’s enabled but sync failed. Manual re-sync still failed. I believe it’s because our servers don’t have Internet access for security reasons. Is there any way I can download otherwise and import into the server? Thanks.

Hey John,

You can actually add them via this page:
https://library.octopus.com/listing

The only downside to adding them manually is if you ever need to update a step template you’ve imported in the future to a version that’s in our library, there will be some manual labor involved.

Please take a look and let me know what you think.

Thanks,
Jeremy

Hi Jeremy,

Thanks for the library link. I see lots of community contributed templates there. Our internet restriction makes this uneasy. I am trying to understand it better -

  • when look at the IIS related templates I see those are all for some specific task, like “IIS Add HTTPS binding” but none of them for a complete deployment. So it looks like I still need to use Octopus built-in step template, like “Deploy to IIS” but try to find community contributes template for some specific task?

  • if that’s true, how can I plug in the downloaded template in my main process?

  • what if the exact step we need is not available in community templates neither?

Sorry for so many questions, and I truly appreciate your help as always!

John

Hi John,

You wouldn’t want to use Deploy to IIS because you have a lot of specific things you want to circumvent in the Deploy to IIS step. You would want to Deploy a Package to get the files to your IIS server, then supplement the Deploy a Package step with community steps and your own custom scripting to get the IIS server in your desired state.

To get the step template into your process, you will go to the library step you want to add, click “Copy to clipboard”

You will then go to Library->Step Templates and click Import

You will paste the JSON into that field and click Save. Now that step template is among the normal steps you can use, found here when adding a step:

As you have a very complex IIS environment, you will likely have to leverage many IIS Step Templates as well as maybe writing your own to supplement.

Please let me know if you have any questions or if the above will work for your use case.

Thanks,
Jeremy

Hi Jeremy,

It looks when select Package, I still have to select Deploy to IIS.Is that correct?

Some other questions:

  1. when Octopus server deploy to Tentacles, what protocol / port it use, is it TCP or UDP, is it just port 10933? some of our servers are in secured vlan, so need to configure firewall rules.

  2. after deploy plain text web.config to destination server, is the process able to run aspnet_regiis command and encrypt the file? The encrypt involves key on server, so can’t deploy pre-encrypted web.config and have to encrypt on the destination servers.

Thanks again and have a nice weekend!

John

Hi John,

You would want to use the Deploy a Package step in your screenshot not IIS, as IIS is doing a lot of stuff that you said you wanted to avoid in your first post (unless that’s changed.)

  1. Listening Tentacles use TCP 10933, Polling Tentacles use TCP 10943.

  2. You would need to create the script for this in a script step, but it should be doable. As a general rule within Octopus, if you can script it outside of Octopus, you can generally use Octopus to do it.

Please let me know what you think.

Thanks,
Jeremy

Hi Jeremy,

Thank you for your direction. I was able to run basic deploy a package, and able to run post deploy script and encrypt web.config.

One thing I didn’t figure out - my initial deployment of a web app may need to include and encrypt web.config, but later routine change most likely need to exclude web.config. But it seems in Deploy a Package that’s not configurable. Is there any way to exclude files in that process?

Thanks!
John

Hi John,

You’re very welcome. I’m glad to hear you’re making some good progress.

To exclude files from being overwritten later (like web.config), you will need to use a custom install directory and choose which files to exclude. Click Configure Features at the top, then enable Custom Install Directory. You should now see some new fields. If you don’t want it to purge the directory, and you don’t have web.config in your package, you dont need to do anything extra. If you have web.config in your package you will need to enable purge and exclude it from the purge and make sure you deploy everything required for your web app.

Please let me know if that helps.

Thanks,
Jeremy