How to integrate Gitlab with JFrog Artifactory? [Video]

How to integrate Gitlab with JFrog Artifactory? [Video]

Vignesh C

How to integrate Gitlab with JFrog Artifactory?

Read the updated post on Gitlab Ci/CD >>

Video Transcript:
Hello everyone. This is Vignesh from JFrog Support. In this short video I’ll show how to integrate GitLab with Artifactory. Let’s begin.

I have an Artifactory instance up and running. I have created a local repository for deploying the artifacts and a remote repository for resolving the packages, and the virtual repository aggregating both local and the remote repository.

In this demo I am going to build and publish a simple Maven project to Artifactory. In order to begin with the integration, first we need to configure the variables required for Artifactory.

To do that, navigate to Settings menu, CI/CD tab, and then Variables section, and configure the variables required for our Artifactory like Artifactory URL, Artifactory username, Artifactory password, and the repository which we are going to deploy.

In this example I have used a virtual repository for both the purposes. This can be used as a resolver as well as deploying. Apart from the basic Maven folder structure, SRC and pom.xml file, we have other two files called configuration.yml file and gitlab-ci.yml file.

In the configuration.yml file we will be specifying the repository name for resolver and deployer, and in the gitlab-ci.yml file it internally uses JFrog CLI. So, before running the script, we have to install the JFrog CLI using the curl command.

Then we have to configure the required parameters for JFrog CLI like username, password and Artifactory URL, and then we will be replacing the actual repository key configured in the configuration.yml file with the variable specified already in the parameters.

The actual build process begins with this step. I am executing the Mvn Clean Install command using JFrog CLI with build name as gitlab-jfrog-demo, and the build number is being taken from GitLab variables. Once, after collecting the environment variables here, I am publishing the same to Artifactory.

By this step, configuration has been completed. Next, to trigger the build, navigate to CI/CD, Pipelines menu. Then click on Run Pipeline button, and then again Run Pipeline button, and you could see the build get started. To save time, I have executed the build already.

You can see in the Job section the build got passed. And you can see here the build was successful, and it got deployed to Artifactory. In the Artifactory you can verify the particular Maven project got successfully deployed, and in the Builds section you can see all the details associated with this particular build.

That’s my video on GitLab integration with Artifactory. Thank you for watching, and I hope you have enjoyed. Feel free to leave your comments, feedback, or questions in the Comment section below. Thank you, and good luck.

Read the updated post on Gitlab Ci/CD >>