Importing projects

CloudBees Jenkins X Distribution allows users to add existing software project source code to the serverless CI/CD build pipeline. Whether your code is stored in a simple local disk directories or stored in a remote version control system such as GitHub or Subversion.

Users who have existing source code into CloudBees Jenkins X Distribution can use the jx import command, which leads a user through an interactive command-line interface that configures your source code with build files, helm charts, and pipeline configuration files as well as initializes your GitHub repository.

  1. Change into your application project directory:

    cd acmeapp/
  2. Run the import from a command-line:

    jx import
  3. The application asks for your Git username (such as acmeuser).

  4. The application asks if you wan to initialize your project in Git.

  5. The application asks you what organization to use for managing builds (for example, acmecorp)

  6. The application asks if you want to name your repository (such as acme-springapp1)

You can now perform builds, commit project code to your newly created Git repository, and CloudBees Jenkins X Distribution will automatically process pull requests and create previews for your applications for testing and validation.

Running the jx import interactive CLI performs the following actions:

  • Adds your source code into a Git repository

  • Create a remote git repository on a git service, such as GitHub

  • Commit your code to the remote Git service

  • Adds default build files to your project:

    • A Dockerfile to build your application as a docker image

    • A pipeline.yaml to implement the CI / CD pipeline

    • A helm chart to run your application inside Kubernetes

  • Registers a webhook (such as http://hook-jx.192.169.1.100.nip.io/hook) on the remote git repository

  • Trigger the first pipeline build

Avoiding docker + helm

If you are importing a repository that does not create a docker image you can use the --no-draft command line argument which will not use Draft to default the Dockerfile and helm chart:

jx import --no-draft

Importing via URL

If you already have a an application project in a remote Git repository and want to incorporate CloudBees Jenkins X Distribution for CI/CD pipeline builds, you can use the --url option:

$ jx import --url https://github.com/jenkins-x/spring-boot-web-example.git

Importing GitHub projects

You can also import projects from a existing github organizations:

$ jx import --github --org acmecorp

You will be prompted for the repositories you want to. Use the cursor keys and space bar to select/deselect the repositories to import.

If you would rather install all the repositories of an organization

$ jx import --github --org acmecorp --all

If you have any questions or feedback on the CloudBees Jenkins X Distribution documentation, send them to jx-feedback@cloudbees.com.

Copyright © 2010-2020 CloudBees, Inc.Online version published by CloudBees, Inc. under the Creative Commons Attribution-ShareAlike 4.0 license.CloudBees and CloudBees DevOptics are registered trademarks and CloudBees Core, CloudBees Flow, CloudBees Flow Deploy, CloudBees Flow DevOps Insight, CloudBees Flow DevOps Foresight, CloudBees Flow Release, CloudBees Accelerator, CloudBees Accelerator ElectricInsight, CloudBees Accelerator Electric Make, CloudBees CodeShip, CloudBees Jenkins Enterprise, CloudBees Jenkins Platform, CloudBees Jenkins Operations Center, and DEV@cloud are trademarks of CloudBees, Inc. Most CloudBees products are commonly referred to by their short names — Accelerator, Automation Platform, Flow, Deploy, Foresight, Release, Insight, and eMake — throughout various types of CloudBees product-specific documentation. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Jenkins is a registered trademark of the non-profit Software in the Public Interest organization. Used with permission. See here for more info about the Jenkins project. The registered trademark Jenkins® is used pursuant to a sublicense from the Jenkins project and Software in the Public Interest, Inc. Read more at www.cloudbees.com/jenkins/about. Apache, Apache Ant, Apache Maven, Ant and Maven are trademarks of The Apache Software Foundation. Used with permission. No endorsement by The Apache Software Foundation is implied by the use of these marks.Other names may be trademarks of their respective owners. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this content, and CloudBees was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this content, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.