Is there any way of promote a build via the Jenkins REST API ?
If there isn't such a way, is there any way of doing it by code (script, etc.) ?
Thanks for your help!
Related
I am trying to automate the update of major version on self-hosted agent, by script. I have searched the docs for Azure DevOps REST API to achive this but no luck. I found a solution online that requires you to reinstall the agent on every machine, which is not what I am after. Anyone have a clue? Is there a way to achieve this through the REST API?
Is there a way to achieve this through the REST API?
The answer is yes.
We could use the REST API Agents - Update to update the version of the agent.
PATCH https://dev.azure.com/{organization}/_apis/distributedtask/pools/{poolId}/agents/{agentId}?api-version=5.1
We do not provide the request body for this REST API.
To get the poolId, we could use the REST API Pools - Get Agent Pools:
GET https://dev.azure.com/{organization}/_apis/distributedtask/pools?api-version=5.1
As the result:
we have 300+ REST APIs for which we are in processing of creating OpenAPI 3 (yaml) specs to be deployed in apigee finally. since the number of api's are bit high, are there any automated ways of validating and specs and deploying them in apigee or other best practices from similar projects
Few options to consider from my experience.
All 300+ API don't need to be hosted as a single API proxy so break your API spec on proxy level.
When making any changes in API spec a good way to keep the review process separate from APIGEE and use the traditional GIT model. Create a repo for API spec in Git/Bitbucket. Here an API designer can make changes in the API spec and submit a PR. In this, you can have validations test for swagger that is available open-source that will check for any validations. Once PR is passed from variations and approved by all the reviewers then you will be sure of quality and format of the API spec.
Next step can be the deployment of the API spec into APIGEE that can be automated using Jenkins CI/CD. I haven't done this part personally but it is possible to do.
Thanks,
Alok
Keep in mind Apigee's limit of a maximum of 50 deployed proxies. http://apigee.googleapis.com/organizations/environments/deployments
You may want to group your APIs into Apigee proxies & utilize proxy endpoints. https://docs.apigee.com/api-platform/reference/api-proxy-configuration-reference#proxyendpoint
Use the Maven Apigee plugin & GitLab CI to have an automated way of deploys.
https://github.com/apigee/apigee-deploy-maven-plugin
please, let me know if you have any questions.
thanks, regards,
I've set up my own GitLab CE server with CI in it. I can already create a webhook to deploy my code to a server just by pushing it. (Many thanks to Matt Jones and his little invention).
However, I still have one issue there. I don't really find a very good description about GitlAbs new feature about Webhook for Build Events. I think I'll need this, since I wish to deploy my code ONLY AFTER a build was succesfull. If I set the webhook for push event, then it has no problem, inmediatly deploys the code. Can any of you provide me with a proper instruction, what do I have to make, to achieve my goal?
Thanks a lot in advance!
I use jenkins for these purposes, you can also set your preferences about when to deploy your code and run pre and post build steps. It's really useful and it has Gitlab integration with the Web hooks.
I have troubles with triggering a workflow with both cli and rest api. It tried it in the same way as it works for normal jobs. For the rest api neither build nor buildWithParameters posts work.
Anyone any solutions?
The CLI command is not yet implemented: JENKINS-28071
The REST APIs build and buildWithParameters should work exactly the same as for freestyle projects.
So I have a current CI setup that enables me to pull metadata from Salesforce org(using Jenkins + Ant migration tool), push it to git, create a package out of it and then re-deploy this package to another Salesforce org.
I have been hearing good things about Stratosource, and would like to know if anyone has managed to integrate Stratosource with Jenkins as part of Continuous Integration cycle.
If so, could someone please provide a few pointers?
I have tried searching for it, but apparently not many documents exist on this topic.
Thanks!