Automating the post-installation steps of a new Artifactory instance

Joey Naor
2020-06-11 08:49

Subject:
Automating the post-installation steps of a new Artifactory instance. 

Instructions:
In cases where UI accessibility is limited or automation is a top priority, it is possible to automate Artifactory’s post-installation configuration process using REST API calls.
In this quick tutorial, we will point the minimal mandatory steps (which are usually completed via the UI) in a newly installed Artifactory.

1. Health check to verify that all the microservices are up and running, and that Artifactory is ready to be configured:curl -u admin:password http://localhost:8082/router/api/v1/system/health2. Provide our product license which will be included in a separate file (license.json):curl -u admin:password -XPOST -H 'Content-Type: application/json' -d @license.json http://localhost:8081/artifactory/api/system/licenseslicense.json:{    "licenseKey": "<license key>"    }3. Confirm that our license is configured correctly:curl -u admin:password http://localhost:8081/artifactory/api/system/licenses4. Change the default password of the admin user to ‘p@ssword1’:curl -u admin:password -XPOST -H 'Content-Type: application/json' -d '{ "userName" : "admin", "oldPassword" : "password", "newPassword1" : "p@ssword1", "newPassword2" : "p@ssword1" }' http://localhost:8081/artifactory/api/security/users/authorization/changePassword
Our Artifactory is now ready to use. We can proceed with creating repositories, users and automate every UI feature using REST API calls.
You may create your own scripts using the REST calls above to finish the setup process over an API method.