Importing a Project
This lesson gives you step by step instructions to import a project into Jenkins X.
We'll cover the following...
We’ll import the application stored in the vfarcic/go-demo-6 repository. We’ll use it as a guinea pig to test the import process and to flesh out potential problems we might encounter.
Fork the repository
But before we import the repository, you’ll have to fork the code. Otherwise, you won’t be able to push changes since you are not yet a collaborator on that specific repository.
open "https://github.com/vfarcic/go-demo-6"
Please make sure that you are logged in and click the Fork button located in the top-right corner. Follow the on-screen instructions.
Clone the repository
Next, we need to clone the repository you just forked.
⚠️ Please replace
[...]
with your GitHub user before executing the commands that follow.
GH_USER=[...]git clone \https://github.com/$GH_USER/go-demo-6.gitcd go-demo-6
Replace the master
branch with the orig
branch
Chances are that I did not leave the master branch in the state I intended it to be or that I’m doing something with it while you’re reading this. I might be testing some recently released Jenkins X feature, or maybe I’m trying to fix a problem from one of the examples. To be sure that you have the correct version of the code, we’ll replace the master
branch with the orig
branch, and push it back to GitHub.
git pullgit checkout origgit merge -s ours master --no-editgit checkout mastergit merge origrm -rf chartsgit push
Inspect the repository #
Now you should have the intended code in the master branch of the repository you forked. Feel free to take a look at what we have by opening the repository in a browser. Fortunately, there is a jx
command that does just that.
jx repo --batch-mode
Exploring the project files
Let’s quickly explore the files of the project before we import it into Jenkins X.
ls -1
The output is as follows:
README.mdfunctional_test.gomain.gomain_test.goproduction_test.govendor