Deploy Before/After Scripts and Environment Variables
Hello,
I have a few questions regarding deployments:
-
Can you execute deploy before/after scripts when you are not doing build trigger deploys? I only see the fields in the UI on build configuration.
-
Are the environment variables defined in the Environments accessible in deploy scripts? I am trying to automate my database migration process and need to access variables specific to the deployment environment.
-
Can you trigger webhooks on deploy success/failure like you can for builds?
Thanks,
Tom
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 Jul 04, 2014 @ 04:27 AM
Hi Tom,
What you are looking for is vNext of deployment we are designing at the moment. Currently, deployment during the build and deployment from Environments page are done separately through they share the same providers. Deployments as part of the build process can access build environment variables and they can call scripts as they run on dedicated VMs.
All your questions make sense and this will be a part of new "unified" deployment mechanism.
2 Posted by Tom on Jul 06, 2014 @ 11:05 PM
Thanks for getting back to me. I'm currently using WebDeploy. Do I have any options before the unified deployment?
There's a runCommand WebDeploy provider.aspx) where I could execute scripts that have been updated with environment variables via parameters.xml, but I don't see a way to configure this in appveyor. Is there something undocumented I can do in appveyor.xml?
Support Staff 3 Posted by Feodor Fitsner on Jul 07, 2014 @ 06:39 AM
The only way to call custom provider right now is to use msdeploy.exe command line.
4 Posted by Tom on Jul 07, 2014 @ 01:06 PM
It looks like the only way to call msdeploy.exe via command line is if you're doing a build deploy, not manual environment deploy, right?
Support Staff 5 Posted by Feodor Fitsner on Jul 07, 2014 @ 01:08 PM
That's correct. Alternatively, you can try agent deployment (Windows Server 2012 and above). It allows running
deploy.ps1
on remote machine as part of deployment package.6 Posted by Tom on Jul 07, 2014 @ 03:03 PM
We are using Azure, so agent deployment on the web server is not a possibility. I'm trying to consolidate with appveyor and avoid having to maintain a server for TeamCity and Octopus Deploy. A manual deployment with before/after scripts is a requirement for me at this time.
Thanks for your responses. Please let me know when the next version of deployment is completed.
7 Posted by Tom on Jul 07, 2014 @ 04:11 PM
Is there any way to export my current project configuration so I have all the setup saved when I'm able to use appveyor?
Support Staff 8 Posted by Feodor Fitsner on Jul 07, 2014 @ 04:49 PM
The best way to preserve config is to use
appveyor.yml
! :)9 Posted by sebastian on Jun 11, 2015 @ 11:59 AM
Feodor, I'm interested in hearing more about this 'vNext' unified deployment system and what you have planned. Can you tell us more or is there anywhere we can get more information about it?
10 Posted by mike on Oct 15, 2015 @ 10:51 PM
I so wish you would add support for giving environment deployment the same features as your build deployment. What I'd like to do is take the artifacts that I built and tested and deploy them to staging. This involved deploying a database update and then an ElasticBeanstalk update. This is not possible without scripts. Otherwise I will have to create another build that creates new artifacts to deploy. I know you're trying to create consistency among other things but a deployment is often a sequence of events. Allowing the Environment Deployment to support a sequence of options just like the build deployment would not only be nice but would be required in a lot of use cases. Love the product other than that limitation.
11 Posted by mr560889223 on Oct 28, 2015 @ 06:44 AM
I'm looking for this feature as deployment to Azure Website is really tricky for us, as we have to use script to stop Azure Web App slot first to avoid file locking issue (our Web App is Orchard-base, an open-source CMS in C#).
It has been a year and I'd really like to know where you guys are regarding this "vNext of deployment". Hopefully it's still on the table?
Support Staff 12 Posted by Feodor Fitsner on Nov 05, 2015 @ 04:50 AM
Hi guys,
I've just blogged about "Deployment projects" simulating "Script" environments: http://www.appveyor.com/blog/2015/11/04/deployment-projects
I think described approach could be adopted for your use cases.
Please take a look and let me know if you have any questions or suggestions. Your feedback is appreciated!
13 Posted by mike on Nov 05, 2015 @ 11:08 PM
Fantastic. This should do it for us!! I’ll try it out in a few days.
Mike Maddox
Development Manager
blossor
Office: (360)255-5304
Cell: (206)419-4323
Ilya Finkelshteyn closed this discussion on Aug 25, 2018 @ 02:01 AM.