How to Go About Importing a Project in Jenkins X?
This lesson explains why we might want to import an existing project in Jenkins X. Moreover, it describes the capabilities of Jenkins X in this matter and gives an overview of the process to do so.
We'll cover the following
We saw how we can fast-track the development and continuous delivery of new applications with Jenkins X quickstarts. However, it is likely that your company was not formed yesterday, which means that you already have some apps and hopefully you’d like to move them to Jenkins X.
An overview of the process
From a Jenkins X perspective, importing an existing project is relatively straightforward. All we have to do is execute jx import
, and Jenkins X will do its magic. It will create the files we need.
- If we do not yet have
skaffold.yml
, it’ll generate it for us. - If we did not create a Helm chart, it would create that as well.
- No
Dockerfile
? No problem, we’ll get that as well. - Never wrote Jenkins pipeline for that project? Again, that is not an issue. We’ll get
jenkins-x.yml
.
Jenkins X will reuse the things we already have and create those that we’re missing.
The import process does not limit itself to creating missing files and pushing them to Git. It will also create a job in Jenkins, webhooks in GitHub, and quite a few other things.
Nevertheless, we’ll go beyond a simple import process since you’re bound to have to tweak the results. Maybe your application needs a database and the chart that will be created through Jenkins X does not include it, or maybe your application has a different path that should be used for Kubernetes health checks. There are many things that your application requires, and not all of them will be detected by the Jenkins X import process.
We’ll go through the exercise of importing a project and trying to figure out whether we are missing something specific to our application. If we are, we’ll fix it. Once we understand which application-specific things are missing, we’ll create a new build pack so that the next time we import an application based on similar technology, the process will be streamlined and consist of a single command. On top of that, we’ll be able to use that same build pack for any new application we might start developing in the future since it will be available as another quickstart option.
For now, let’s focus on importing a project and solving potential problems we might encounter. Later on, we’ll dive into build packs and try to create our own based on the experience we’ll obtain by importing an existing application.
Let’s get started and create a Kubernetes cluster with Jenkins X (if you deleted the previous one).
Get hands-on with 1400+ tech skills courses.