How to checkout Artifactory repo in jenkins workspace - jenkins

I am new to artifactory just wanted to know if there is a way to checkout artifactory repo similar to git repository so that the content of the artifactory repo is visible in the Jenkins workspace.
For git repo we get options like checkout as a subfolder I want to know if we can do something similar to that for artifactory in Jenkins
Any suggestions

Git is the VCS and Artifactory is a repository manager and I doubt that this cannot be done. Artifactory in Jenkins is used for retrieving/downloading the packages, resolving the dependencies and deploying the build to Artifactory. If my understanding in incorrect, kindly elaborate on the use-case for better. Refer to the below wikis for better understanding,
https://www.jfrog.com/confluence/display/JFROG/Jenkins+Artifactory+Plug-in
https://www.jfrog.com/confluence/display/JFROG/Declarative+Pipeline+Syntax
https://www.jfrog.com/confluence/display/JFROG/Scripted+Pipeline+Syntax
https://github.com/jfrog/project-examples/tree/master/jenkins-examples/pipeline-examples/declarative-examples

Related

Put Maven plugins in Artifactory repository

I would like to set up a Maven repository with Artifactory.
What are the steps to setup Maven plugins repo in Artifactory. I have to load Maven Jacoco plugin from Artifactory local repo.
Seems your use case can be achieved with general instructions of Maven Repository of Artifactory. Since, you would like to deploy maven type package/plugins, there would no difference in the setup.
We should be able resolve the deployed packages/plugins from maven clients without any issues. Is there anything difference in the use case?

How to import a jar file from jfrog artifactory into Jenkins .m2 repository?

I have a Jfrog Artifactory installation which has some artifacts. I want to pull these artifacts onto my Jenkins .m2 repository. I don't have much knowledge of Jenkins.
As long as you have properly configured you maven remote repository settings, maven will resolve the artifacts and place them in the local repo during the build process.
Alternatively, (not recommended), you can use curl or wget and mvn install:install-file -Dfile=<path-to-file> ... , but that is rather pointless and more work than letting maven do what maven does.
Cloudbees has recommendations for settings if you don't want them in you repo's settings.xml; S/O answer has some advice, as does the pipeline-maven plugin and the Jenkins Docs.

Jenkins discover my github repositories automatically

I want to discover my scm (github) repositories automatically by Jenkins. Is there a plugin or other way to make this happen?
Not exactly sure about the requirement, you are talking about. We can always set up webhook in our GIT repo and link that to jenkins job. When ever you make any commit in GIT repo, that will trigger jenkins job automatically.

CI/CD in gitlab through mirror repository

I have been wanting to set up a CI/CD pipeline for a repository in its mirror repository. I have found articles on how to mirror a repo but I cannot find how to set up CI/CD in it and view the results in original repo. Can anyone suggest me how to do it?
how to set up CI/CD
It's the same approach as if without mirroring - you just add .gitlab-ci.yml file to your original git repository, it gets mirrored to GitLab which then runs pipelines for you
how to ... view the results in original repo
You didn't specify where you host your original repo.
If it's a GitHub, then you will see GitLab pipelines on your GitHub Pull Requests.
It's the same as with any other CI tool integrated with GitHub.
Links:
https://docs.gitlab.com/ee/ci/yaml/
https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/
https://docs.gitlab.com/ee/ci/ci_cd_for_external_repos/github_integration.html

Usage of SVN private repository with Jenkins instead of GIT

I am keeping all my code in SVN repository within my on-premise server. And also I am trying to implement the CI/CD pipeline for deploying my application. I am trying to use Kubernetes and Jenkins tools for implementing this. When I am exploring the implementation examples of CI/CD pipeline using Jenkins and Kubernetes, I am only seeing example with GIT repository and managing code commits using Webhooks.
Here my confusion is that, I am using SVN code repository. So How I can use my SVN code repository with Jenkins Pipeline Job ? Do I need to install any additional plugin for SVN ? My requirement is that, when I am committing into my SVN code repository, Jenkins need to pull code from code repo and need to build project and need to deploy in test environment.
Hooks to trigger Jenkins from SVN are also possible. Or you can poll the repository for changes - the Jenkins SVN plugin supports both methods (https://wiki.jenkins.io/display/JENKINS/Subversion+Plugin). The examples you are looking at will have a step that does a build from the source code of a particular repo. You should be fine to swap git for SVN and still follow the examples as where and how the source is hosted is not normally related to how to use Jenkins to build and deploy it.

Resources