Skip to content

Commit 9741c0b

Browse files
Initial katacodaDockerCompose
1 parent ce6dc7c commit 9741c0b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

runners/katacoda/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,18 @@ export class Katacoda extends Runner {
209209

210210
}
211211

212+
runDockerCompose(step: Step, command: Command) : RunResult {
213+
let cdCommand = this.changeCurrentDir(path.join("/root", "devonfw", "workspaces", "main"));
214+
215+
this.steps.push({
216+
"title": "Execute Docker Compose",
217+
"text": "step" +this.stepsCount + ".md"
218+
});
219+
220+
this.renderTemplate("dockerCompose.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, cdCommand: cdCommand, filePath: command.parameters[0].replace(/\\/g, "/"); })
221+
return null;
222+
}
223+
212224
private renderTemplate(name: string, targetPath: string, variables) {
213225
let template = fs.readFileSync(path.join(this.getRunnerDirectory(),"templates", name), 'utf8');
214226
let result = ejs.render(template, variables);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<%= text; %>
2+
3+
## Docker Compose
4+
5+
<%= cdCommand; %>
6+
7+
Navigate to the folder in which your Dockerfile is.
8+
9+
`cd <%= filePath; %>`{{execute}}
10+
11+
Now you can use docker-compose up.
12+
13+
`docker-compose up`{{execute}}
14+
15+
<%= textAfter; %>

0 commit comments

Comments
 (0)