I’m trying to get octopus to deploy windows service to EC2 instance.
I’ve added a new “Deploy windows service” step, filled the required info and when running the deploy looks like octopus automatically creates some custom script named “Bootstrap.Octopus.Features.WindowsService_AfterPreDeploy.ps1” which fails with the following error:
“mkdir : Cannot find drive. A drive with the name ‘D’ does not exist.
Error mkdir -Force $logDirectory | out-null”
And it makes sense because EC2 instance indeed doesn’t have D drive.
The problem is that I can’t figure out where that D drive param comes from.
- I’ve set all the octopus parameters for this deploy step to point to D drive instead of C.
- I’ve tried to login to EC2 instance hoping to find that script and see what’s inside but seems like it gets created during this deploy step and immediately deleted after the step fails.
- I’ve changed deploy step to “Run a Script” where I added a script required to start the service but deployment still fails before getting to my script. Right now it looks like octopus automatically creates a differently named file: “Bootstrap.Octopus.Action.CustomScripts.Deploy.ps1” but it still fails with the same error when trying to execute ‘mkdir’ on D drive and my custom script definitely doesn’t have this command! It comes from octopus internally somehow.
- I’ve mapped D: drive to C: using
net useand I’m able execute
mkdir D:\testfrom EC2 instance but octopus build still fails with the same error.
Could you please tell me what parameter to set to C drive? And why octopus tries to execute
mkdir before executing my custom script? That’s really weird because all other octopus files and configs are in C:\Octopus