Skip to content

Building Jmix Projects



Creating a Dockerfile for the Project 1

  • Go to the IntelliJ IDEA window and in the navigation pane select Deployment->Docker->New->Dockerfile

    Image

    ../assets/img/jmix/docker_create.png

  • If necessary, set the Dockerfile creation parameters and click OK.

    Image

    ../assets/img/jmix/docker_conf.png

  • Edit and save the Dockerfile if needed.

Creating a Repository and Connecting the Project 2 3

  • Create a project using Jmix according to the official guide 4
  • Create and configure a project on the GitFlic platform.
  • Leave the CI/CD template and .gitignore file fields empty. Jmix creates a .gitignore file with the necessary rules by default. We will add the CI/CD template later, after preparing and configuring the CI/CD agent.

    Image

    ../assets/img/jmix/initialize.png

  • If necessary, configure the project collaboration rules.

  • Open the IntelliJ IDEA terminal (Alt+F12 by default).
  • Run the command to initialize the repository.

    git init .
    
  • Connect the project to the local repository:

    git remote add origin #Path to the project on gitflic, for example "https://gitflic.ru/project/superuser/onboarding.git"
    
  • Add files to the repository index and create the first commit.

    git add .
    git commit -m "Initial commit"
    
  • Push the files to the project on GitFlic

    git push origin master
    

Creating and Connecting the GitFlic Runner Agent

To use the jmix CI/CD template, you need an agent of type docker with the didEnable option enabled! 5

Creating a CI/CD Template and Building the Application

  • In the web interface of the project on GitFlic, go to the CI/CD tab and click create new template

    Image

    ../assets/img/jmix/create_pipe.png

  • Select the Jmix project template by clicking Use on the corresponding card

    Image

    ../assets/img/jmix/jmix_pipe.png

  • In the editor window, adjust the template if necessary. If building and publishing a Docker image is not required, completely remove the docker-build task.

  • Click Create configuration and confirm the changes

    Image

    ../assets/img/jmix/editor_approve.png

  • Go to the CI/CD tab in the project and make sure the pipeline was created and the agent started executing tasks

    Image

    ../assets/img/jmix/pipe.png

  • After the pipeline completes successfully, go to the Container and Package Registry tab. The created Docker image with the application will be there.

    Image

    ../assets/img/jmix/registry.png

  • Click on the card with the created Docker image for more details

    Image

    ../assets/img/jmix/registry_inspect.png

  • Check the build correctness and application availability by running a Docker container from the created image

    docker run --rm -ti #Link to the created image, for example registry.gitflic.ru/project/superuser/jmix-onboarding/onboarding:latest
    

Automated translation!

This page was translated using automatic translation tools. The text may contain inaccuracies.


  1. If building and publishing a Docker image is not required and/or you already have a Dockerfile, skip this section. 

  2. The onboarding starter repository from Jmix is used as an example. 

  3. If you already have a repository, you can skip this section. 

  4. If you already have a Jmix project, you can skip this step. 

  5. The didEnable option is not available in cloud agents on gitflic.ru. It is recommended to use a self-hosted agent. To build using cloud agents, you need to modify the Docker image build task.