Importing an existing project from GitHub

It is not always possible to start with clean project templates. Often, you will need to create a pipeline for an existing project. Let's perform the following steps to add some existing project source code into a GitLab environment:

  1. Log in to GitLab with a non-root user account.
  2. If you don't have a project yet, click the Create a project button on the Welcome to GitLab screen. If you have created projects before, click the New project button in the top right-hand corner of the following view:

  1. GitLab can import projects from various Git repositories, including GitHub, Bitbucket, Google Code, Fogbugz, Gitea, and GitLab itself. Here, select the Import project tab and choose GitHub:

  1. Open https://github.com/settings/tokens in a new window and go to your GitHub account.
  2. Click on Generate new Token on your GitHub account.
  3. For GitLab to be able to access your GitHub account, an access token needs to be created. On the New personal access token page, select the repo scope and click on the Generate Token button. This page shows the permissions that you can assign with the token:

  1. Copy the new personal access token created on GitHub, paste it into GitLab, and click on the List your GitHub repositories button:

  1. GitLab will access and discover projects in your GitHub repository location. Import the repository that you want to use with this recipe. In this example, we will use the project from the https://github.com/k8sdevopscookbook/auto-devops-example repository. This is where all the examples in this book are located:

When importing is complete, the status will show Done. Finally, click on the Go to project button to see your project in GitLab.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.239.44