This article provides a step-by-step guide for integrating TeamCity with Artifactory using the TeamCity Artifactory plugin, followed by deploying RPM packages to an Artifactory repository. In this example, we will focus on deploying RPM packages to an Artifactory RPM repository.
Step 1:
To begin, you need to install the Artifactory plugin on the TeamCity server.
1. To install the plugin, go to Admin > Plugins, and then click on "Browse Plugins Repository."
2. This will open a new page where you can type "Artifactory" in the search bar and download the Artifactory plugin ZIP file.
3. Next, upload the ZIP file you downloaded in the "Upload Plugin ZIP" section, as shown below:
4. After the plugin is uploaded and appears in the list, click "Enable."
5. Now we should be able to see Artifactory in the Integration section.
Step 2:
Configure the Artifactory server in TeamCity:
1. To connect the TeamCity to Artifactory server, you need to create an Artifactory server configuration. Navigate to Integrations - > Artifactory, then click on "Create New Artifactory Server Configuration."
2. Enter your Artifactory server details and verify the connection using test connection. Once the test connection is successful we can click on save.
Artifactory server URL: https://<ARTIFACTORY_URL>/artifactory
Following these steps, the Artifactory server configuration is complete.
Step 3:
Configure the Build configuration in order to deploy the RPM packages to the Artifactory repository.
1. Go to the “Projects” section and click on “Create project”.
2. After entering the name and project ID, click on "Create Build Configuration."
3. Depending on your requirements, you can choose between the repository URL option or manual configuration. In this example, I will demonstrate the manual method. Click "Create" to proceed.
4. Now go to “Build steps” and “Add build step”:
5. Next, select "Command Line" in the build step.
6. Now, select the Artifactory server URL (where the package will be deployed) as shown below:
7. After selecting the Artifactory server URL, you can add the necessary steps. In the example below, Uploading an RPM package. Once done, click "Save."
8 . Click on "Run" to start the build.
9. Once the build process is completed, you should see a "Build Successful" message in the build logs, indicating that the deployment was successful and the RPM package was uploaded to Artifactory without any issues.
Step 4:
To verify that the package has been successfully deployed, check the Artifactory repository. You should be able to see the uploaded RPM package listed there.
Adding the screenshot of my Artifactory server where the package got deployed successfully along with the build info.
Following these steps, you've successfully integrated TeamCity with Artifactory and deployed an RPM package to an Artifactory repository. The Artifactory TeamCity plugin simplifies this process by automating deployment tasks and allowing seamless interaction between the two tools.