Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local build command replacing local create #2048

Merged
merged 8 commits into from
Feb 19, 2021

Conversation

doru1004
Copy link
Contributor

@doru1004 doru1004 commented Feb 17, 2021

This patch enables the changes outlined in issue #2038

Concretely the patch brings in the following CLI changes:

  1. inspect is now local inspect with no other functional changes
  2. local create has been renamed to local build and has had the functionality expanded:

In addition to the features of local create, local build can also now create a directory structure with the integration files: property files, routes and dependencies.

kamel local build --integration-directory <dir-name> file1.yaml file2.java file3.groovy

The directory will be created in the parent directory of where the command was invoked and will contain the following directory structure:

<dir-name>/properties
<dir-name>/routes
<dir-name>/dependencies

The properties, routes and dependencies subdirectories will contain the respective integration files.

For convenience one can output just the dependencies as follows:

kamel local build --integration-directory <dir-name> --dependencies-only file1.yaml file2.java file3.groovy
  1. local run can now take as input an integration directory constructed by local build. Only full integration directories can be processed i.e. directories created with --dependencies-only are not supported.

local run can use an integration directory as input and run the integration locally:

kamel local run --integration-directory <dir-name>

local run can use an integration directory and run the integration within a container:

kamel local run --integration-directory <dir-name> --containerize --network=host --image <image-name>

For now, if route files contain modeline options which depend on lazily evaluated environment variables (for example [[env:ENV_VAR]]) then the command above will need to specify the environment variable explicitly like so:

kamel local run --integration-directory <dir-name> --env ENV_VAR
kamel local run --integration-directory <dir-name> --containerize --network=host --image <image-name> --env ENV_VAR

Release Note

- transform current inspect command to: kamel local inspect
- rename kamel local create to kamel local build
- enable kamel local build to construct a local directory hierarchy, at a custom location specified by the user, containing all the elements required by the integration.
- enable kamel local run to pick up integration directory and just run the integration locally.
- enable kamel local build to save just the dependencies in a custom location specified by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants