before-deploy.ps1 is never executed
Hi
I have a project targeting .Net Framework 4.6.1 in which I added two scripts and named them as described in your documentation:
https://www.appveyor.com/docs/deployment/agent/#running-powershell-scripts-on-target-server-during-deployment
On every build, deploy.ps1 is always called and works perfectly, but no matter what I try (including it to the csproj one way or another, or not at all), before-deploy.ps1 isn't.
The documentation simply states "PowerShell script in the root of application folder will be called before every deployment.", so I guess there's nothing special that needs to be done here, right?
Also, I'm running the latest AppVeyor Agent version on a fully updated Windows Server 2016.
I suppose you might need more information from me. Please feel free to ask.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 22 Jul, 2020 04:03 PM
Hi Matt,
What kind of app is that?
before-deploy.ps1
is supported only with "web" (deploy_website
) and "windows" apps (deploy_app
,deploy_service
).What do you get in deployment log? For
before-deploy.ps1
the agent is simply iterates over all zip package entries untilbefore-deploy.ps1
is found. Unpack the package to see if it containsbefore-deploy.ps1
.2 Posted by Matt on 22 Jul, 2020 04:27 PM
Hi Feodor, and thanks for the quick follow-up.
This is indeed a website, with
deploy_website
is totrue
.You were right: the script wasn't in the deployed zip file. I just ran another build / deploy after setting "Copy - Always" to the script file from its Visual Studio properties, and it worked perfectly.
Added to the .csproj file:
Thanks a lot for your help!
Support Staff 3 Posted by Feodor Fitsner on 22 Jul, 2020 11:20 PM
Great, thanks for the update!
Feodor Fitsner closed this discussion on 22 Jul, 2020 11:20 PM.