Last updated: Jan 08, 2020 15:04
CircleCI is a cloud-based CI/CD tool. An on-premises solution is also available. CircleCI automatically runs your build in a clean container or virtual machine, allowing you to test every commit. It supports any language that builds on Linux, Windows, or macOS, including C++, Javascript, .NET, PHP, Python, and Ruby.
This section guides you through the process of creating a CircleCI account and integrating it with a Maven project. A sample project is available here: https://github.com/PerfectoMobileSA/MavenCircleCISample
To integrate CircleCI with a Maven project:
- Follow the CircleCI instructions here to sign up and try CircleCI for free: https://circleci.com/docs/2.0/first-steps/
You sign up with your GitHub or Bitbucket account. - Perform the instructions provided in the readme.md file.
- To help CircleCI webhooks to listen for git updates, create the following in the root of your repository:
- A folder called
.circleci
- A
.yml
file calledconfig.yml
The file path to this file should be:.circleid/config.yml
- A folder called
In the
config.yml
file, add the following code. The content is self-explanatory.Notes:
- Replace
MavenCircleCISample
with your project folder name. - The
run
command contains the Maven goals. You can tweak them as needed for your project. For enhanced security and as a best practice, we add the
cloudName
(for exampledemo
) and the Perfecto security Token as environment variables to our project. Follow the steps here to set up environment variables for your project. For information on security tokens, see Generate security tokens.- CircleCI automatically builds for every commit and performs a nightly execution at 12:00am UTC due to a nightly trigger workflow.
You can add CircleCI status badges to your
readme.md
file. For example,![CircleCI status](https://circleci.com/gh/PerfectoMobileSA/MavenCircleCISample.svg?style=shield "CircleCI status"
will showcase the current build status of CircleCI in GitHub. For instructions, see here.
- Replace