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

Change for supporting development in windows #971 & #902 #1102

Merged
merged 5 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,36 @@ npm update && npm install
npm install -g @vscode/vsce
vsce package
```

## To run karavan-web in the local machine for debugging

#### Prerequisite
Docker Engine 24+

1. Make the following change in package.json line 5-12 (needed only for Windows)
```
"scripts": {
"copy-designer": "xcopy ..\\..\\..\\..\\..\\karavan-designer\\src\\designer src\\designer /E/H/Y",
"copy-knowledgebase": "xcopy ..\\..\\..\\..\\..\\karavan-designer\\src\\knowledgebase src\\knowledgebase /E/H/Y",
"copy-topology": "xcopy ..\\..\\..\\..\\..\\karavan-designer\\src\\topology src\\topology /E/H/Y",
"copy-code": " npm run copy-designer && npm run copy-knowledgebase && npm run copy-topology",
"start": "set PORT=3003 && npm run copy-code && react-scripts start",
"build": "npm run copy-code && DISABLE_ESLINT_PLUGIN=true react-scripts build"
},
```

2. Add local profile config to the application.properties
```
# Local
%local.karavan.image-registry=localhost:5000
%local.karavan.infinispan.hosts=localhost:11222
%local.karavan.git-repository=http://localhost:3000/karavan/karavan.git
%local.karavan.image-registry-install=true
%local.karavan.git-install-gitea=true
%local.quarkus.http.host=localhost
```

3. Run ./karavan-web/karavan-app in Quarkus Dev mode
```
mvn clean compile quarkus:dev -Dquarkus.profile=local,public
```
6 changes: 2 additions & 4 deletions karavan-core/test/plain.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import {expect} from 'chai';
import * as fs from 'fs';
import 'mocha';
import {CamelDefinitionYaml} from "../src/core/api/CamelDefinitionYaml";
import {Integration} from "../src/core/model/IntegrationDefinition";
import {FinallyDefinition} from "../lib/model/CamelDefinition";


describe('Plain YAML to integration', () => {
Expand Down Expand Up @@ -57,7 +55,7 @@ describe('Plain YAML to integration', () => {
const i = CamelDefinitionYaml.yamlToIntegration("test1.yaml", yaml1);
(i.spec.flows?.at(0)).autoStartup = false;
const y = CamelDefinitionYaml.integrationToYaml(i);
expect(y).to.equal(yaml2);
expect(y).to.equal(yaml2.replaceAll("\r\n", "\n")); // replace for Windows compatibility
});

it('YAML <-> Integration', () => {
Expand All @@ -68,7 +66,7 @@ describe('Plain YAML to integration', () => {
expect(i.spec.flows?.length).to.equal(1);
expect(i.type).to.equal('plain');
const yaml2 = CamelDefinitionYaml.integrationToYaml(i);
expect(yaml.replace("\r\n", "\n")).to.equal(yaml2); // replace for Windows compatibility
expect(yaml.replaceAll("\r\n", "\n")).to.equal(yaml2); // replace for Windows compatibility
});

});
Loading