Jenkins Configuration - ambitus/artifactory-vault GitHub Wiki
Note that Jenkins configuration requires that you have admin privileges. If you are unable to complete the following steps, that means that you do not have sufficient privileges. In that case you will need to contact an admin to help you.
⚠️ Note that you may need to have the following Java Configuration configured on your Jenkins agent (https://<your jenkins server>.com/computer/<your agent>/configure) to avoid potential SSL protocol errors that can occur once you start using Artifactory in Jenkins. Note that this may only be applicable to IBM Java and or z/OS UNIX Jenkins agents. If you do not encounter any SSL protocol errors, and your Jenkins agent is able to successfully interface with Artifactory, you can disregard this information.
- JavaPath:
/path/to/folder/where/java/executable/lives
- JVM options:
-Djava.io.tmpdir=/u/<user that hosts jenkins agent>/jenkins/tmp -Dfile.encoding=ISO8859-1 -Xnoargsconversion -Dhttps.protocols=TLSv1.2 -Djdk.tls.client.protocols=TLSv1.2 -Dcom.ibm.jsse2.overrideDefaultTLS=true -Dcom.ibm.jsse2.overrideDefaultProtocol=TLSv1.2
- Prefix Start Agent Command:
export JAVA_HOME=/path/to/folder/where/java/executable/lives && export IBM_JAVA_ENABLE_ASCII_FILETAG=ON && . /u/<userid>/.profile &&
- Ensure that you have a repository on your Artifactory server and a user with permission to read and or write to that repository.
- Ensure that you have the Artifactory plugin installed in Jenkins.
- Create a new Global Credential at
https://<Your Jenkins Server>/credentials/store/system/domain/_/newCredentials
⚠️ Choose ONE of the Authentication methods below. You can authenticate with Artifactory in one of two ways:
- Username and Password
- Username and API Key
-
Username and Password Credentials:
- Kind: Leave as "Username and Password"
- Scope: Leave as "Global"
- Username: Use your Artifactory username
- Password: Use your Artifactory password (Use your API Key if using API Key authentication)
- ID: Arbitrary, used to reference this credential
- Description: Optional. Add a description if you like.
- In Jenkins, navigate to the Manage Jenkins/Configure System page.
- Locate the Artifactory section.
- If you DON'T see an empty form, click the button labeled Add Artifactory Server to create a new empty form.
- Select the box labeled Use the Credentials Plugin if it is NOT already selected.
⚠️ If people already have Artifactory servers configured here WITHOUT using the Credential Plugin, do NOT select the check box to switch to using the Credential Plugin because this will break everyone else's Artifactory Server configuration. It is suggested that you collaborate with the people who have configured Artifactory server(s) on the Jenkins server you are working with to switch everyone over to using the Credential Plugin instead.
- Fill out the fields in the empty form as follows:
- Server ID: Arbitrary, used to reference this Artifactory server
-
URL: Enter the URL where the Artifactory server you want to use is hosted.
https://<host/ip where artifactory is running>:<port if needed>/artifactory
- Credentials: Use the drop-down to select the credentials you created in the previous steps.
- Click Test Connection to verify that everything works.
- Click the button in the left-hand corner that is labeled Save.
- One-time setup for admins: An admin only has to configure the Artifactory server once. The owner of the credential is responsible for the life-cycle of their credential. If anything about the credential changes, the owner manages these changes. The burden does not have to be on an admin to update credentials that change.
- Ability to use API Key Authentication: Artifactory allows you to authenticate using API Keys, and the Credential Plugin allows you to create "Secret text" credentials where you can store API Keys that you can use for authenticating with Artifactory from Jenkins.
- Confidentiality of passwords/API Keys: Admins do not need to know your Artifactory password or API Key in order to configure an Artifactory server for you. They only need to know which Jenkins Global credential to use.