Deploy to Specific Installation Folder

Good day,

I’d like to setup Deployment in a specific folder and it deploys in that specific folder but creates 3 extra folders.

Details:

I want to install in lets say C:\wwwroot\ but now what it does is it installs in C:\wwwroot{ENVIRONMENT}{PROJECT}{VERSION}\ which is not where my IIS is pointing. I do not want to re-point my IIS everytime I deploy since the version will change.

I’ve used the feature to install in a specific directory but it still creates those extra folders.

Could you please advise?

PS: I use Nuget Packages to Deploy.

Shany Grimard

Hi Shany,

Thanks for getting in touch! Octopus creates new directories for each deployment and re-points IIS to the new directory for a few reasons.
But if you don’t want this to happen or are forced to use a specific directory then the Custom Installation Directory is the feature you are looking for.
http://docs.octopusdeploy.com/display/OD/Custom+Installation+Directory

Vanessa

Good day,

This did not work. No files have been moved.

See the Variable:

[cid:image001.png@01CFF41A.A06BF370]

My Step Details in Process:

[cid:image002.png@01CFF41A.A06BF370]

C:\inetpub\wwwroot\ChartPad_Development\Test is empty when I would expect all the files to be moved there.

All files are located have been extracted to C:\inetpub\wwwroot\ChartPad_Development\DEVELOPMENT\ChartPad\1.0.2.

I thought you mentioned the files are supposed to be copied over ?

Could you please advise asap as we will be deciding next week if we plan on buying this tool or not…

Regards,

Shany Grimard

Hi Shany,

Thanks for the reply. Can you send the deployment log?
http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task
Did you create a new release when you tested the new feature?

Vanessa

Good day Vanessa,

By creating a new release it worked. If I understand, anything you change in the configuration is tied to a Release then? This is why the old release didn’t pick up my new settings.

Is there a way to turn off IIS? Or to point it to a temporary folder while you’re making changes to the directory?

Regards,

Shany Grimard

Hi Shany,

Yes a release is a snapshot of not just the process but also variables and packages.
We keep a release in this state as it is then the same across all environments, and considered stable with its details. If you were to update a variable in the future that the old code doesn’t recognize, that specific release would break if it wasn’t in a static state.

As for your question about IIS. What changes are you making to the directory? When you don’t use Custom Installation Directory your site or application stays live until all the changes through Octopus are made, then IIS is even re-pointed at the directory. But even when you do use Custom Installation Directory, we also do majority of the code changes in a completely separate directory before we do the move, as you can see here:
http://docs.octopusdeploy.com/display/OD/Package+deployment+feature+ordering

But if you are doing something that needs IIS turned off or restarted, yes there is probably a library script that does just that.
https://library.octopusdeploy.com/#!/listing

Vanessa

Good day Vanessa,

Thanks for the replies.

How does it know where to point if I wouldn’t use “Custom Installation Directory”? And how does it know which site to re-point in IIS if I have multiple sites running on the same machine ?

Regards,

Shany Grimard

image001.jpg

Hi Shany,

It creates a brand new directory each time based on environment, project and version,
Then using the settings here: http://docs.octopusdeploy.com/display/OD/IIS+Websites+and+Application+Pools
It points IIS to the new directory when everything is done.

Vanessa

Good day,

I have one more question. I’m trying to setup DbUp to update my database so I created a ChartPadDbUp Project inside my solution. When I create my OctoPack with MSBUILD, it(the DBUP Console Project) is not included in the NuGet Package… I’ve added OctoPack to the new project. It only generates the same NuGet that it was generating before (with only the application in it and not the DBUP Console Project).

Could you please advise?

Regards,

Shany Grimard

Hi Shany,

Each project inside a solution gets it’s own NuGet package. It really is the preferred solution because then you can create a separate step for each - as especially with database steps they have their own install needs. You should find that if you use OctoPack to build your solution, the dbup project will have its own NuGet package in the bin folder.

Vanessa

Good day Vanessa,

I was wondering if I could use Octopus Variables in the powershell scripts inside Octopus Step Process Configuration ?

I need to rename a file through Powershell but depending on the environment, it’s located in a different folder, therefore I would use variables tied to Environments.

Could you please advise?

Regards,

Shany Grimard

Hi Shany,

You can run a StandAlone powershell script as an Octopus step and use the Octopus variable OctopusParameters[‘Octopus.Environment.Name’] to get the name of the environment to which you are currently deploying.

Example:

$ConfigFile = "C:\Inetpub\MyWebApp\Staging\Web.config"
$NewName = "Web." + $OctopusParameters['Octopus.Environment.Name'] + ".config"
Rename-Item $ConfigFile -NewName $NewName -Verbose

If we were deploying to an environment called “Staging”, the file will be renamed to Web.staging.config

The attached GIF shows you how to find this Octopus Variable.

Regards,

dalmiro

Thanks for the reply. One last question;

Is there a way I can use the Release Version of my Project (the one you create when you create a release) inside a Variable?

My use case:

1- I use NuGET Package Version for the Release Version (when creating a release inside Octopus)

2- I want that Version to be copied automatically inside one of the Variables and use that variable inside my web.config to replace a key value.

Could you please advise?

Regards,

Shany Grimard

image001.jpg

Hi Shany,

We have a variable Octopus.Release.Number available for every deployment, and as you can bind variables you could use this where you need it.
There is also Octopus.Action.Package.NuGetPackageVersion which if used outside of the scope of the step would be called via Octopus.Action[stepname].Output.Package.NuGetPackageVersion

Hope this helps!
Vanessa

Good day,

How do I use them(Octopus.Release.Number) inside the Variables TAB under Octopus ? Let’s say I want to use Octopus.Release.Number inside my web.config (using transformations).

Regards,

Shany Grimard

Good day,

Do you have an ETA on the following Feature?

If not, do you have a workaround ?

Regards,

Shany

Hi Shany,

In a web.config you should just be able to place #{Octopus.Release.Number} where you want it replaced (if it is inside appSettings or configurationStrings).
If it is outside of those then you need to use the Substitute variables in files features and explicitly name the file and it will then replace.

As for the feature you linked, this has not been reviewed or scheduled yet, and also appears to have a bit of a debate happening in the comments.

Thanks!
Vanessa

Thank you,

Is there a way to Deploy only specified files? Let’s say I want to update a single Javascript file, is there a way to tell Octopus not to deploy the rest of the files?

Regards,

Shany Grimard

image001.jpg

Hi Shany,

There isn’t an out of the box way to do this on Octopus. We believe in deploying entire Nuget packages (vs single files) as a good practice. This way if something goes wrong and you need to do a rollback, you can always re-deploy an (entire) previous package, and not a package + a specific file that you have to look for on your source control.

That said, you could do one of the following:
A)

  • Deploy package (with your full app including the updated) Javascript file to a temp location
  • Include a Powershell step to only copy that file to you app directory.

B) Create and Deploy a Nuget package that only contains your updated Javascript file. Make sure to “Purge Directory” unchecked!

Hope that helps!

dalmiro

Good day,

I would like to continue the Free Community Edition. How do I do so ?

Regards,

Shany Grimard

From: Paul @ Octopus Deploy [mailto:hello@dripemail2.com] On Behalf Of Paul @ Octopus Deploy
Sent: Tuesday, December 2, 2014 11:00 AM
To: Shany Grimard
Subject: [MARKETING] Octopus Deploy trial: Your trial expires soon

Hello!

I just wanted to reach out and let you know that your Octopus Deploy trial will expire in 2 days time.

How did the trial go? Did you hit any problems along the way? I’d really love to hear about your experiences so far.

To keep using all the features you’ve been using during the trial, you can head over to our purchasing pagehttp://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiNjEzNTIyMSIsImRlbGl2ZXJ5X2lkIjoiNzQ3ODQ1MSIsInVybCI6Imh0dHBzOi8vb2N0b3B1c2RlcGxveS5jb20vcHVyY2hhc2U_X192aWQ9ZWMyNzUwOTAzMjBlMDEzMjllNmMyMjAwMGIyYTg4ZDdcdTAwMjZ1dG1fY2FtcGFpZ249b2RcdTAwMjZ1dG1fbWVkaXVtPWVtYWlsXHUwMDI2dXRtX3NvdXJjZT1vY3RvcHVzLXRyaWFsIn0 to purchase a license.

I sincerely hope that you had a good experience during your trial, and have gotten value out of deployment automation and our product. If there’s one thing we could have done to make anything easier during your trial, what would it be?

Thanks once again for trying Octopus, and happy deployments!

Paul Stovell
Founder, Octopus Deploy
You received this email because you signed up for the Octopus Trial email list. To make sure you keep getting these emails, please add hello@octopusdeploy.commailto:hello@octopusdeploy.com to your address book or whitelist us. Want out of the loop? Unsubscribehttp://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiNjEzNTIyMSIsImRlbGl2ZXJ5X2lkIjoiNzQ3ODQ1MSIsInVybCI6Imh0dHBzOi8vd3d3LmdldGRyaXAuY29tL3N1YnNjcmliZXJzL2o3Ymt2cTFhdnNqdzFhbmE3aXpwL3Vuc3Vic2NyaWJlP19fdmlkPWVjMjc1MDkwMzIwZTAxMzI5ZTZjMjIwMDBiMmE4OGQ3XHUwMDI2ZD1kZmhveHRwc3hqYnVyOHhia3B4eVx1MDAyNmV4Y2x1ZGVfY2xpY2s9MSJ9.

Our postal address: PO BOX 308, Indooroopilly, QLD, 4068 Australia

Confidentiality Notice: This e-mail communication and any attachments may

contain confidential and privileged information for the use of the designated

recipients named above. If you are not the intended recipient, you are hereby

notified that you have received this communication in error and that any

review, disclosure, dissemination, distribution or copying of it or its

contents is prohibited. If you have received this communication in error,

please notify me immediately by replying to this message and deleting it

from your computer. Thank you.