DEV Community

Cover image for IntelliJ IDEs and CircleCI integration by 🌀CIclone!
Mitz
Mitz

Posted on

IntelliJ IDEs and CircleCI integration by 🌀CIclone!

Samuraism Inc. has announced a new product: a plugin for JetBrains IDEs named CIclone [sάɪkloʊn]

https://samuraism.com/products/ciclone (Ja)

🌀CIclone?

🌀CIclone provides seamless integration of JetBrains IDEs with several CI services such as Jenkins, GitHub Actions, and CircleCI. It is a paid plugin, but the price is reasonable. In addition, it's available at no additional cost if we have a personal license with them. (and I have it :D)

I checked the CircleCI integration of the plugin because I like CircleCI and I'm working for CircleCI as an engineer (๑•̀ㅂ•́)و✧

The plugin seems super nice!

Execution result notification

When we push code changes, CircleCI starts the pipeline. Then, 🌀CIclone tells us the result by the IDE notification. We don't need to switch to other applications, but we can keep coding on the IDE after the push and can know the execution result. nice

Execution result notification

Workflow execution results view

Even after we receive notifications, we can still stay on the IDE and check the execution status (success/failed), the job list, and even the execution logs there. nice

Workflow execution results view

Jump to the failed tests

If there are some tests failed, we can jump to the test cases on the source code. nice

Jump to the failed tests

In addition, we can run unit tests on the IDE from there. nice

Jump to CircleCI page

It's also possible to jump to CircleCI page from the IDE. We just select the workflows or jobs on the view and click the following button, then the CircleCI site is open on the browser. nice

Jump to CircleCI page1

For example, we can see the page like this:

Jump to CircleCI page2

Trigger pipeline

We can trigger pipeline by clicking the execution button and specifying branch. nice

Trigger pipeline

Rerun workflow

Selecting the executed workflow, we can rerun the workflow from the rerun button. nice

Rerun workflow

It seems super nice!

With 🌀CIclone, now I can get CircleCI notifications in the IDE, check logs, re-run, etc., without switching apps while writing code, which seems very convenient!

I don't have any Java projects right now, but I might try it with a Clojure or JavaScript project. If the language is not yet supported by 🌀CIclone, I don't think it is possible to jump to the code or execute UT, but still it is possible to see the CI results and receive notifications. I have a feeling that would be so useful!

Below are notes on setting up this project

Create a sample project: hello-ciclone

I created a Maven project with Spring Initializr. It's been a while since I've used Java!

Then I wrote a simple config.yml

version: 2.1

jobs:
  build-and-test:
    docker:
      - image: cimg/openjdk:17.0.3
    steps:
      - checkout
      - run:
          name: Build
          command: mvn -B -DskipTests clean package
      - run:
          name: Test
          command: mvn test

workflows:
  sample:
    jobs:
      - build-and-test
Enter fullscreen mode Exit fullscreen mode

Clicked "Set Up Project" on the CircleCI project list:

Set Up Project

select the config.yml in the main branch:

select the config.yml

After that, it automatically executes UT when I push code

I added a few tests, and some of them succeed and some others fail.

The project preparation is done.

IDEA configuration

Next is a configuration on IDEA. I got license from Samuraism at first, then activated it. But I think we can try it without license for the 30 days trial period.

Install plugin. Preferences > Plugins > Marketplace and type "ciclone" to find the plugin and install it.

Install plugin

After rebooting IDEA, next was to set up CircleCI integration, Preferences > Tools > CircleCI

CircleCI integration

I wanted to get a new token from CircleCI, so I clicked the "Get Token" link to open CircleCI page for token generation:

Get Token

And "Create New Token" to generate a new token with some name and copied the value. Then pasted it to the config page of IDEA, and click "Import from existing project". I could see the list of my CircleCI projects:

list of my CircleCI projects

Chose the project I created just now and it became like this. The "Max Pipeline Size" seems the history count of the pipeline to retrieve. The default is five and I think it's good for me for now.

CircleCI integration2

Clicked "Test"

Test

It works!ヽ(=´▽`=)ノ

🌀CIclone View

When we finish the configuration, we can see CircleCI tab at the bottom, so choosing it and click the sync button on the left top of the view to get the latest pipeline results:

CIclone View

Now we can use it as I wrote in the first half of this article!

Top comments (0)