Skip to main content

7. Build From Git

Inline mode is the fastest way to start. As soon as an integration matters, its source belongs in a repository: it is reviewed, versioned and released like any other code.

This step is a detour: the integration does the same thing, built from Git.

Inline source versus Git source​

Both modes build the same integration. They differ in where the source lives and in what you can do with it.

InlineGit
Where the route livesIn the integration, in the consoleIn a repository
History and reviewRevisions of the integrationCommits, branches, merge requests
What is deployedWhat was typedA branch, or a release
Several files, tests, shared codePossible, quickly awkwardNatural
Best forTrying something, a small route, a demonstrationAnything that goes to production

Nothing else changes: settings, deployment, exposure and security work the same in both modes.

Repository layout​

In Integration Fabric, create a repository for the integration (or use one you already have) and add the route to it:

A repository for the integration, for example
orders-api/
└── src/main/resources/routes/
└── orders.camel.yaml

Commit it. When the route is ready to be deployed, create a release: a named, fixed version of the repository.

Git source by repository, branch or release​

Create a new integration, or edit orders-api, and set Source mode to Git. In Git Project:

  1. choose the repository;
  2. choose what to build: a branch, to follow its latest commit, or a release, to deploy exactly that version.

For a private repository, the integration needs credentials: a configuration of the kind Git Repository Credentials.

Deploy. The build now starts from the repository instead of the text typed in the console.

Branch builds versus release builds​

In Git mode you choose what to build. The choice decides whether two deployments can differ without a decision.

Build fromYou getUse it in
A branchThe latest commit, each time you deployDevelopment
A releaseAlways the same sourceTest and production

Deploying a release means that what runs in production is exactly what was tested.

Do not build production from a branch

A branch build takes whatever the branch holds at the moment of the deployment. Two production deployments a day apart may differ without anyone having decided it. Point production at a release.

Settings preserved across source modes​

The properties, variables, files and certificates of step 3 and step 4 are settings of the integration, not part of its source. They stay as they are when you change the source mode, and they keep differing by environment.

That separation is the point: the repository holds what the integration does, the settings hold where it runs.

Next: expose the integration.