adoptium / infrastructure

This repo contains all information about machine maintenance.
Apache License 2.0
84 stars 100 forks source link

Automate creation of node in jenkins after deploying static container #3507

Open Haroon-Khel opened 3 months ago

Haroon-Khel commented 3 months ago

An additional feature of the dockernode.yml playbook will be to automate the creation of the jenkins node of a newly deployed container. Python's jenkins library should facilitate this

Haroon-Khel commented 3 months ago

For 2Q when the project is created

sxa commented 3 months ago

Python's jenkins library should facilitate this

We also have some groovy code for this in https://github.com/adoptium/jenkins-helper/blob/master/src/NodeHelper.groovy which may be useful.

Haroon-Khel commented 2 months ago

Experimented with https://pypi.org/project/jenkinsapi/ and https://pypi.org/project/python-jenkins/. I hit this error on both of their create_node/slave() function

  File "/Users/hkhel/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://ci.adoptium.net/computer/doCreateItem

Doesnt look like a permissions error.

I tried using ansible's jenkins_script module which allows for executing groovy commands on a jenkins server, https://docs.ansible.com/ansible/latest/collections/community/general/jenkins_script_module.html, no luck

Haroon-Khel commented 1 month ago

Putting this on the back burner for a while. I've closed the epic it belongs to because I have completed its main objectives