Skip to content

Commit ec9b8a6

Browse files
Merge branch 'main' into feature/katacodaDockerCompose
2 parents a047f34 + 1d19ff1 commit ec9b8a6

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

documentation/Functions.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ installDevonfwIde(["java","mvn"], "2020.08.001")
1919

2020
***
2121

22+
### restoreDevonfwIde
23+
#### parameter
24+
1. The tools you want to install within the devonfw ide: string array
25+
2. Optional: The version of the ide to install
26+
#### example
27+
restoreDevonfwIde(["java","mvn"], "2020.08.001")
28+
#### details
29+
In the Katacoda environment the installation of the devonfw IDE is executed in a startup script.
30+
***
31+
2232
### installCobiGen
2333
#### parameter
2434
* No parameters
@@ -105,3 +115,4 @@ Please try not to use custom placeholders. Keep in mind that you might want to b
105115
dockerCompose("exampleproject")
106116

107117
***
118+

runners/console/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export class Console extends Runner {
5252
return result;
5353
}
5454

55+
56+
runRestoreDevonfwIde(step: Step, command: Command): RunResult {
57+
return this.runInstallDevonfwIde(step, command);
58+
}
59+
5560
runInstallCobiGen(step: Step, command: Command): RunResult {
5661
let result = new RunResult();
5762
result.returnCode = 0;
@@ -158,6 +163,10 @@ export class Console extends Runner {
158163
}
159164
}
160165

166+
async assertRestoreDevonfwIde(step: Step, command: Command, result: RunResult) {
167+
this.assertInstallDevonfwIde(step, command, result);
168+
}
169+
161170
async assertInstallCobiGen(step: Step, command: Command, result: RunResult) {
162171
let assert = new Assertions()
163172
.noErrorCode(result)

runners/katacoda/index.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export class Katacoda extends Runner {
6969

7070
runInstallDevonfwIde(step: Step, command: Command): RunResult {
7171
let cdCommand = this.changeCurrentDir("/root");
72-
7372
let tools = command.parameters[0].join(" ").replace(/vscode/,"").replace(/eclipse/, "").trim();
7473

7574
// create script to download devonfw ide settings
@@ -93,6 +92,26 @@ export class Katacoda extends Runner {
9392
return null;
9493
}
9594

95+
runRestoreDevonfwIde(step: Step, command: Command): RunResult {
96+
let tools = command.parameters[0].join(" ").replace(/vscode/,"").replace(/eclipse/, "").trim();
97+
98+
// create script to download devonfw ide settings.
99+
this.renderTemplate(path.join("scripts", "cloneDevonfwIdeSettings.sh"), path.join(this.setupDir, "cloneDevonfwIdeSettings.sh"), { tools: tools, cloneDir: "/root/devonfw-settings/"});
100+
this.renderTemplate(path.join("scripts", "restoreDevonfwIde.sh"), path.join(this.setupDir, "restoreDevonfwIde.sh"), {});
101+
102+
// add the script to the setup scripts for executing it at the beginning of the tutorial
103+
this.setupScripts.push({
104+
"name": "Clone devonfw IDE settings",
105+
"script": "cloneDevonfwIdeSettings.sh"
106+
});
107+
this.setupScripts.push({
108+
"name": "Restore Devonfw IDE",
109+
"script": "restoreDevonfwIde.sh"
110+
});
111+
112+
return null;
113+
}
114+
96115
runInstallCobiGen(step: Step, command: Command): RunResult {
97116
this.steps.push({
98117
"title": "Install CobiGen",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
mkdir devonfw
4+
cd devonfw
5+
6+
mkdir -p /root/.devon/
7+
touch /root/.devon/.license.agreement
8+
echo "you accepted the devonfw-ide License.https://github.com/devonfw/ide/blob/master/documentation/LICENSE.asciidoc" >> /root/.devon/.license.agreement
9+
10+
wget -c https://bit.ly/2BCkFa9 -O - | tar -xz
11+
12+
bash setup /root/devonfw-settings/settings.git
13+
14+
15+
. ~/.bashrc

0 commit comments

Comments
 (0)