4D Blog

Home Tips How to Implement Continuous Integration with 4D: A Step-by-Step Guide

How to Implement Continuous Integration with 4D: A Step-by-Step Guide

March 21, 2024

Tips

In the world of software development, a new concept has appeared in recent years called “Continuous Integration.” The definition we see or hear everywhere is :

“CI is a process that automates the compilation, testing, and delivery of an application on a regular and frequent basis.”

Having understood this definition, which expresses an interesting and promising process, what do I need to do to implement it in 4D? If you search the Internet, you’ll find that there are many CI tools and frameworks available.

However, there are several prerequisites before using these CI tools.

Step 1: Convert a 4D application into a project

To implement CI in 4D, you first need to convert your 4D application into a project. This involves migrating to project mode if your application is currently in binary mode. During conversion, the “.4DB” binary file is split into several large text files, which can then be placed on source control.

You can find a whole blog series explaining the concepts of project mode:

  • Project databases: From binary to text-based
  • Project databases: Architecture
  • Project databases: Post conversion

 

Or follow these 4D training:

  • Switching to Project Mode to make the most of 4D feature
  • PROJECT MODE: What, Why, How?

Step 2: Utilize a source control system

Managing your code with a version control system like Git is essential for successful CI implementation.

As a first step, if you want to test and experiment with a source control system, you can try GitHub. Simply create an account on GitHub, and you can create your own private or public repository free of charge. Then, depending on your needs, you can invest in a source control server like Git Lab hosted by your organization.

To get started with Git and 4D, explore these blog posts:

  • How to share your 4D code via GitHub
  • Project databases: Git. Commit. Pull. Push & more
  • gitignore and 4D: a useful feature for Git users
  • Saving project source code without tokens

 

A very detailed guide explains the different ways you can work with 4D and source control, either as part of a team or on your own:

  • Introduction to 4D and Version Control Systems (VCS)

 

We also recommend checking out the keynote and breakout session from 4D Summit 2020:

  • Keynote
  • Session: 4D and Git: A new era of collaboration has begun

 

Depending on your chosen source control system, you can easily find training courses adapted to your preferred tool.

Step 3: Compile or Build applications without an interface

A method or function must be designed to compile and build your application without an interface and without user intervention. You can write your methods using the Compile project or Build application commands.

Alternatively, you can simply use the Build4D component. This component lets you build a compiled structure, a component, a standalone application, or a Client/Server application. The component and its source code are available on GitHub under the MIT license. This means you can use it for free, make a fork on GitHub to modify it as you wish if you have particular needs, and use it on your installations without constraint.

Here’s a series of blog posts on the Build4D component:

  • Build your Compiled Structure or Component with Build4D
  • Create a standalone application with the Build4D component
  • Create a Client/Server Application with the Build4D tool

Step 4: use the command line to execute

Once you’ve written the script to compile and build the application, all you have to do is run the script from the command line.

You can pass several parameters via the command line, such as the path to 4D, the project, etc. You can also pass information specific to your code with the “–user-param” parameter.

Valuable resources for command line execution:

  • CLI documentation
  • Improving databases tests
  • How to automate the compilation

 

And for logging actions or errors:

  • Files, Folders… and now File Handles!

Step 5: Automate processes for each commit

The final step is to launch your script for each commit on the source control server. If you’ve chosen Git as your source control, you can simply use the Git action. You can use the classic 4D Developer Edition or the new “tool4D” tool to automate your script.

tool4D is a specialized tool, designed for CLI execution in headless mode and optimized for automating CI processes. tool4D runs automatically in headless mode. Some features are unavailable, such as an application server, Web server, SQL server, and 4D Write Pro and 4D View Pro components. No license is required to run tool4D, so you can easily automate compilation or build without having to install a license in the virtual machine.

To learn more about utilizing Git actions and tool4D, refer to these blog posts:

  • How to take advantage of GitHub actions with 4D
  • A Tool for 4D Code Execution in CLI
  • tool4D documentation

 

And follow this 4D training:

  • Get started with 4D and Git

To resume

In conclusion, implementing CI with 4D can significantly enhance your development workflow. Begin by converting to the project. Then, familiarize yourself with the concepts of a version control system. Write the scripts to compile and build your application. Finally, automate the process with each commit.

You can see all these steps in detail in this 90-minute training course available on 4D.

By following these steps, you’re ready to dive into the exciting world of continuous integration!

Discuss

Tags 21, Build application, Build4D, CI with 4D, CLI, Git, GitHub, Project, Source control, tool4D

Latest related posts

  • September 15, 2025

    Find the right spot in your 4D Write Pro document with AI

  • September 2, 2025

    Intelligent 4D Write Pro document analysis with AI

  • August 25, 2025

    ORDA – Constructor and touched event – Detailed behaviour through a network

Vanessa Talbot
Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy