programmaticly run build and / or deployment
Hi
We are looking at migrating our current CI from teamcity to
appveyor
Our standard workflow (commit =>build and test) was nice and
easy to setup (after some nuget issues)
we also use the teamcity rest API to kick off custom builds,
with a basic process of:
Create aws instance
Kick off teamcity build on given branch and deploy to given ed
point using webdeploy
Using appveyor, I cat see anyway to do this? A I missing
something, or is it a feature on the roadmap?
If the latter, our use case would be to run a new build
specifying:
Branch
Build configuration
End point for webdeploy
Iis path for web deploy
Or in an appveyor world should I change this flow so I get the
build on commit process to produce the deployment package and then
when we want a custom aws instance just deploy that package
ourselves? Or can you add/customise an environment via API and
programmatically kick off the deploy of a named artifact?
I guess the first option is similar to the process described
here:
http://www.infoq.com/articles/AppVeyor-CI
And a final one, I assume a webdeploy from appveyor will come from an ip anywhere in the azure pool? Just thinking ahead to possible firewall issues if the web deploy port is blocked by default?
Hope that all makes sense
Cheers
Steve
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
1 Posted by stevebaker2001 on 06 Jun, 2014 09:17 AM
sorry - just saw the answer here: http://help.appveyor.com/discussions/questions/305-trigger-a-build
so thats great - though the docs only talk about Teams - no mention I could see of builds. Good to know we can effectively discover the api using chrome tools though.
For the build api, what parameters can be passed? branch ticks one of ours, but can you do build config? or any environment variables?
Support Staff 2 Posted by Feodor Fitsner on 06 Jun, 2014 05:33 PM
To do a build with custom config you should take
create project -> update project -> run build -> update project -> run build -> ...
.Though I see it might be interesting to have API method to start a new build with YAML configuration as another parameter ;)
I will publish docs for Projects and Builds APIs today.
3 Posted by stevebaker2001 on 06 Jun, 2014 05:45 PM
Or just allow environment vars to be overwritten/set? Ie
Build{
Environment:{
Configuration:release,
AnotherVar:test
}
}
Support Staff 4 Posted by Feodor Fitsner on 06 Jun, 2014 06:46 PM
Sounds nice too.
5 Posted by stevebaker2001 on 09 Jun, 2014 09:43 AM
in the meantime - is there an api we can use to list / get artifacts?
or to modify and push to an environment?
My thinking is:
Option 1: run web deploy locally (similar to the infoq article)
run build on branch XXX -> list artifacts -> pull artifact locally -> run web deploy
Option 2: use a "temp" environmentrun build -> modify TEMP environment endpoint -> push to environment
my pref would be option #2
on the ideas above, do you track any of this stuff in public (uservoice etc) or is it all on a Magic List (a la github et al)?
Support Staff 6 Posted by Feodor Fitsner on 09 Jun, 2014 05:03 PM
Yes, you can modify environment settings using API. What deployment provider do you use?
7 Posted by stevebaker2001 on 10 Jun, 2014 03:03 PM
we use web deploy - so think this will all work, one of the guys is running through the steps now
Support Staff 8 Posted by Feodor Fitsner on 10 Jun, 2014 04:25 PM
OK, let me know about the results.
9 Posted by petrikvandervel... on 13 Jun, 2014 05:04 AM
Has the documentation for Projects and Builds been published anywhere yet? I couldn't find it on the website but I may well have missed it.
Support Staff 10 Posted by Feodor Fitsner on 13 Jun, 2014 05:05 AM
REST API?
11 Posted by petrikvandervel... on 13 Jun, 2014 05:09 AM
To be honest, anyway I can get information about a project while executing powershell code prior to a build. So either REST API or via the AppVeyor console application or ... However I'm assuming that you meant the REST API in message #3 in this thread.
Support Staff 12 Posted by Feodor Fitsner on 13 Jun, 2014 05:47 AM
Yeah, I meant docs for the rest of REST API :)
13 Posted by JP on 04 Jul, 2014 04:01 PM
Hey Feodor,
Have hit a dead end on our programmatic REST API implementation.
I tried setting the branch to build as a property in the request body of the /builds POST, but it was always building using the one specified in the Project settings.
So then I started looking at changing that first via a /projects POST. I'm getting an invalid request because ["The RepositoryProvider field is required."], but if I watch the same call in Chrome Dev Tools that property isn't in the payload...
What are the valid RepositoryProvider values? (We're using GitHub)
Support Staff 14 Posted by Feodor Fitsner on 05 Jul, 2014 04:22 AM
POST to /projects means creating a new project. RepositoryProvider can be
gitHub
,bitBucket
,vso
andkiln
(all camelCase).Most probably you should look into PUT /projects which means "update". Though its payload is quite huge at the moment.
15 Posted by stevebaker2001 on 05 Jul, 2014 09:33 AM
For put, do you have to send the full payload, or can we just send the
properties we want to update?
Support Staff 16 Posted by Feodor Fitsner on 05 Jul, 2014 10:01 AM
Yeah, it's full payload right now, sorry.
17 Posted by stevebaker2001 on 05 Jul, 2014 11:04 AM
OK. Guess we just run a get, change, then put. Will give that a whirl next
week
18 Posted by JP on 09 Jul, 2014 10:53 AM
Hey Feodor,
GET --> change --> PUT isn't working for us.. (Using full payload although we're only changing repositoryBranch)
Any chance you could publish the docs for Projects and Builds?
Thanks!
Support Staff 19 Posted by Feodor Fitsner on 09 Jul, 2014 11:28 AM
If we add "branch" support to
POST /builds
payload - would it solve the problem?20 Posted by JP on 09 Jul, 2014 11:32 AM
Well I thought it was already in there (http://help.appveyor.com/discussions/questions/305-trigger-a-build) but it wasn't working for me, and that's why I was asking after the docs..
That would absolutely solve the issue though, yeah :)
Support Staff 21 Posted by Feodor Fitsner on 09 Jul, 2014 11:35 AM
That was my fault. There is "branch" in request, but it's not used yet.
I'll fix that.
22 Posted by JP on 09 Jul, 2014 12:00 PM
Ahhh fantastic! Thank you so much for your support! :)
Support Staff 23 Posted by Feodor Fitsner on 14 Jul, 2014 11:47 AM
AppVeyor update has been deployed supporting
branch
parameter inPOST /builds
request. Give it a try and let me know how it goes.24 Posted by JP on 14 Jul, 2014 02:02 PM
That's perfect. Thanks very much!
25 Posted by JP on 14 Jul, 2014 04:41 PM
Would it be possible to get something similar -- a
server
parameter inPOST /deployments
request?Support Staff 26 Posted by Feodor Fitsner on 14 Jul, 2014 05:00 PM
Will see if this could be easily added.
27 Posted by JP on 14 Jul, 2014 05:05 PM
Our situation is multiple servers in an "environment" farm. So ideal could be
environmentId
(which we have already) and server? :)28 Posted by JP on 18 Jul, 2014 01:52 PM
Hey Feodor,
I've been trying to update the `server` for an Environment using PUT, but for some reason even if I copy and paste the exact same payload from the request sent by the UI, I only ever seem to get "Object reference not set to an instance of an object." back.
What am I doing wrong?
`$.ajax({type: "PUT", url: "https://ci.appveyor.com/api/environments", data: {"deploymentEnvironmentId":0000, "environmentAccessKey":"xxxxxxxxxxxxxx", ...}});`
Support Staff 29 Posted by Feodor Fitsner on 18 Jul, 2014 02:33 PM
Make sure the request is authenticated? Try using some other tool (Fiddler, Postman, etc.) to send the request and see if it goes through.
30 Posted by JP on 18 Jul, 2014 02:39 PM
I'm just using Chrome Dev Tools for now, so won't it already be authenticated thanks to the login cookie? Should I be explicitly passing the accountName and bearerToken in the payload?