You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -42,6 +40,10 @@ The following functions are already implemented:
42
40
2.[createFolder](#createFolder)
43
41
3.[restoreWorkspace](#restoreWorkspace)
44
42
43
+
*[Other Function](#otherFunctions)
44
+
1.[addSetupScript](#addSetupScript)
45
+
2.[executeCommand](#executeCommand)
46
+
45
47
***
46
48
47
49
## cobiGenFunctions <aname="cobiGen"></a>
@@ -371,7 +373,7 @@ This function has consist of two parameters.
371
373
372
374
***
373
375
374
-
## File Functions <aname="fileSpecific"></a>
376
+
## File And Directory Functions <aname="fileSpecific"></a>
375
377
376
378
### i. changeFile <aname="changeFile"></a>
377
379
This function is used to insert, append and replace some text in a file.
@@ -448,61 +450,7 @@ This function will work without a devonfw-ide installation.
448
450
449
451
***
450
452
451
-
### iii. displayContent <aname="displayContent"></a>
452
-
This function is only used when you want to display content such as text, image or any file content in your tutorial.
453
-
454
-
#### Parameter:
455
-
This function consists of two parameters.
456
-
457
-
1. First parameter:
458
-
-**Required**
459
-
-**Type**- String
460
-
-**Description**- The title of the step.
461
-
462
-
Note: The title should never be empty and it is of type string.
463
-
464
-
2. Second parameter:
465
-
-**Required**
466
-
-**Type**- Array of JSON objects with files, content, or images to be rendered within the Katacoda step.
467
-
-**Description**-This function consists of three attributes. The use for this function is to display an image and some descriptive text. No Katacoda syntax is allowed in the files or the content!
468
-
* First attribute: "file": Path to a file whose content is to be displayed in the Katacoda step (e.g. .asciidoc or .txt file). The file should be following the formating of asciidoc files.
469
-
* Second attribute: "content": Plain text to be displayed in the Katacoda step. This Text should be following the formating of asciidoc files.
470
-
* Third attribute: "image": Path to an image to be displayed in the Katacoda step. It should be placed under subfolder of the playbook directory.
471
-
472
-
#### Example:
473
-
* displayContent("Step title", [{ "file": "files/description.asciidoc" }, { "content": "This is just plain content." }, { "image": "files/image.png" }])
474
-
475
-
#### Formatting rules for content and .asciidoc or .txt files.
476
-
* You can add headers to structure your text. The generated headers are shown in the examples below. The headers should fit into the overall structure of the generated wiki so level 1 header are not allowed, but the other header can be used at your judgement.
477
-
* A list always needs an empty newline between the last row and the list.
478
-
* Use asciidoc style of links
479
-
480
-
#### Example for content and .asciidoc or .txt files:
481
-
```
482
-
Existing header structure
483
-
= Level 1: tutorial title
484
-
== Level 2: subtitle
485
-
=== Level 3: prerequisites and learning goals
486
-
== Level 2: steptitle
487
-
=== Level 3: titles from functions
488
-
==== Level 4: subtitles from functions
489
-
== Level 2: conclusion
490
-
491
-
List:
492
-
This an unordered List (The empty line is necessary)
493
-
494
-
* First Item
495
-
* Second Item
496
-
497
-
Link:
498
-
The tutorials repository can be found https://github.com/devonfw-tutorials/tutorials/issues[here].
499
-
```
500
-
##### Note:
501
-
1. You should avoid using any command inside any text file for which you want to display content. This will cause problems with the console runner and the tests.
502
-
503
-
***
504
-
505
-
### iv. downloadFile <aname="downloadFile"></a>
453
+
### iii. downloadFile <aname="downloadFile"></a>
506
454
This function is used to download a file from an external URL.
507
455
#### Parameter:
508
456
This function consist of 3 parameters.
@@ -526,7 +474,7 @@ The command for execution will be generated by Katacoda runner, so user will hav
526
474
527
475
***
528
476
529
-
### v. openFile <aname="openFile"></a>
477
+
### iv. openFile <aname="openFile"></a>
530
478
This function is used to open a particular file.
531
479
532
480
#### Parameter:
@@ -542,86 +490,57 @@ This function consist of one parameter
1. For Katacoda, only first parameter is required.
563
-
2. The script will run in the background while starting the tutorial. Katacoda user will have to wait till the script execution is in process. Once it is done it, Katacoda user will get the message and then command prompt will be available to Katacoda user.
564
-
565
-
***
566
-
567
-
### ii. executeCommand <aname="executeCommand"></a>
568
-
This function is used when you want to use a bash (or powershell/cmd on windows) command.
502
+
-**Description**- The title of the step.
569
503
570
-
#### Parameter:
571
-
This function consists of four parameters.
504
+
Note: The title should never be empty and it is of type string.
572
505
573
-
1. First parameter:
574
-
-**Required**
575
-
-**Type**- String
576
-
-**Description**-It contains the input which is a command. The command that will be executed on Windows.
577
-
578
506
2. Second parameter:
579
507
-**Required**
580
-
-**Type**- String
581
-
-**Description**-It contains the input which is a command. The command that will be executed on Linux.
582
-
583
-
3. Third parameter:
584
-
-**Required**
585
-
-**Type**- JSON object
586
-
-**Description**- This parameter consist of three attribute. It is a JSON object with optional fields
587
-
* First attribute: (Optional) Directory where the command will be executed, if not in current directory (relative to workspace)
588
-
Example: {"dir": string}
589
-
* Second attribute: (Optional) Synchronous or asynchronous process. Use asynchronous when starting a server. Default is synchronous.
590
-
Example: {"asynchronous": boolean}
591
-
* Third attribute: (Optional) Array of arguments
592
-
Example: {"args": string[]}
593
-
594
-
4. Fourth parameter:
595
-
-**Required**
596
-
-**Type**- JSON object
597
-
-**Description**- This parameter consist of three attributes which are the assertion information. Assertion information is needed if you start a server to check server availability. Only required when you start a asynchronous server. This parameter is only needed when the command is an asynchronous command.
598
-
* First attribute: "startupTime" which is the time in seconds to wait before checking if the server is running
599
-
* Second attribute: "port" which is the port number on which the server is running
600
-
* Third attribute: "path" which is the path to the URL path on which is checked if the server is running
508
+
-**Type**- Array of JSON objects with files, content, or images to be rendered within the Katacoda step.
509
+
-**Description**-This function consists of three attributes. The use for this function is to display an image and some descriptive text. No Katacoda syntax is allowed in the files or the content!
510
+
* First attribute: "file": Path to a file whose content is to be displayed in the Katacoda step (e.g. .asciidoc or .txt file). The file should be following the formating of asciidoc files.
511
+
* Second attribute: "content": Plain text to be displayed in the Katacoda step. This Text should be following the formating of asciidoc files.
512
+
* Third attribute: "image": Path to an image to be displayed in the Katacoda step. It should be placed under subfolder of the playbook directory.
601
513
602
-
#### Commands:
603
-
It is needed to pass a command for Windows and also for Linux-based systems because both systems will always be tested.
514
+
#### Example:
515
+
* displayContent("Step title", [{ "file": "files/description.asciidoc" }, { "content": "This is just plain content." }, { "image": "files/image.png" }])
604
516
605
-
##### Assertion information
606
-
startupTime = Time in seconds to wait before checking if the server is running
607
-
port: Port on which the server is running
608
-
path: The URL path on which is checked if the server is running
609
-
interval: The availability of the server is checked in the given interval
610
-
* (Required) port: will throw error if no port is given.
611
-
* (Optional) path: subpath which should be pinged, i.e: if localhost:8081/jumpthequeue should be checked path should be "jumpthequeue". DEFAULT: ""
612
-
* (Optional) interval: interval in seconds in which the server should be pinged until it is available or timeouted. DEFAULT: 5 seconds
613
-
* (Optional) startupTime: seconds until a timeout will occur and an error will be thrown. DEFAULT: 10 minutes
517
+
#### Formatting rules for content and .asciidoc or .txt files.
518
+
* You can add headers to structure your text. The generated headers are shown in the examples below. The headers should fit into the overall structure of the generated wiki so level 1 header are not allowed, but the other header can be used at your judgement.
519
+
* A list always needs an empty newline between the last row and the list.
520
+
* Use asciidoc style of links
614
521
615
-
#### Example:
522
+
#### Example for content and .asciidoc or .txt files:
Will create a command to execute the script in the directory with the parameter --params 5 and in the current command prompt. The command prompt will be blocked until you stop the script.
Starting a server in a new terminal. You have to specify the port for testing, the other parameters are optional. The startupTime can specify how long the runner will wait for a response from the server process and with interval you can set the frequenzy for the server testing. The path is the subpath from your server that should be reached.
539
+
Link:
540
+
The tutorials repository can be found https://github.com/devonfw-tutorials/tutorials/issues[here].
541
+
```
542
+
##### Note:
543
+
1. You should avoid using any command inside any text file for which you want to display content. This will cause problems with the console runner and the tests.
625
544
626
545
***
627
546
@@ -760,3 +679,89 @@ will run "git clone https://github.com/[GitHub-name]/[playbook-name]" and checko
760
679
Learn more about the workspace directory and working directory on [Structure](https://github.com/devonfw-tutorials/tutorial-compiler/wiki/Structure)
761
680
762
681
***
682
+
683
+
## Other Functions <aname="otherFunctions"></a>
684
+
685
+
### i. addSetupScript <aname="addSetupScript"></a>
686
+
This function is used to add a script which is executed on startup of the tutorial.
687
+
#### Parameter:
688
+
This function consist of two parameters
689
+
1. First parameter:
690
+
-**Required**
691
+
-**Type**- String
692
+
-**Description**- Path of the script (Linux). Relative to the playbook directory.
693
+
2. Second parameter:
694
+
-**Required**
695
+
-**Type**- String
696
+
-**Description**- Path of the script (Windows). Relative to the playbook directory.
1. For Katacoda, only first parameter is required.
703
+
2. The script will run in the background while starting the tutorial. Katacoda user will have to wait till the script execution is in process. Once it is done it, Katacoda user will get the message and then command prompt will be available to Katacoda user.
704
+
705
+
***
706
+
707
+
708
+
### ii. executeCommand <aname="executeCommand"></a>
709
+
This function is used when you want to use a bash (or powershell/cmd on windows) command.
710
+
711
+
#### Parameter:
712
+
This function consists of four parameters.
713
+
714
+
1. First parameter:
715
+
-**Required**
716
+
-**Type**- String
717
+
-**Description**-It contains the input which is a command. The command that will be executed on Windows.
718
+
719
+
2. Second parameter:
720
+
-**Required**
721
+
-**Type**- String
722
+
-**Description**-It contains the input which is a command. The command that will be executed on Linux.
723
+
724
+
3. Third parameter:
725
+
-**Required**
726
+
-**Type**- JSON object
727
+
-**Description**- This parameter consist of three attribute. It is a JSON object with optional fields
728
+
* First attribute: (Optional) Directory where the command will be executed, if not in current directory (relative to workspace)
729
+
Example: {"dir": string}
730
+
* Second attribute: (Optional) Synchronous or asynchronous process. Use asynchronous when starting a server. Default is synchronous.
731
+
Example: {"asynchronous": boolean}
732
+
* Third attribute: (Optional) Array of arguments
733
+
Example: {"args": string[]}
734
+
735
+
4. Fourth parameter:
736
+
-**Required**
737
+
-**Type**- JSON object
738
+
-**Description**- This parameter consist of three attributes which are the assertion information. Assertion information is needed if you start a server to check server availability. Only required when you start a asynchronous server. This parameter is only needed when the command is an asynchronous command.
739
+
* First attribute: "startupTime" which is the time in seconds to wait before checking if the server is running
740
+
* Second attribute: "port" which is the port number on which the server is running
741
+
* Third attribute: "path" which is the path to the URL path on which is checked if the server is running
742
+
743
+
#### Commands:
744
+
It is needed to pass a command for Windows and also for Linux-based systems because both systems will always be tested.
745
+
746
+
##### Assertion information
747
+
startupTime = Time in seconds to wait before checking if the server is running
748
+
port: Port on which the server is running
749
+
path: The URL path on which is checked if the server is running
750
+
interval: The availability of the server is checked in the given interval
751
+
* (Required) port: will throw error if no port is given.
752
+
* (Optional) path: subpath which should be pinged, i.e: if localhost:8081/jumpthequeue should be checked path should be "jumpthequeue". DEFAULT: ""
753
+
* (Optional) interval: interval in seconds in which the server should be pinged until it is available or timeouted. DEFAULT: 5 seconds
754
+
* (Optional) startupTime: seconds until a timeout will occur and an error will be thrown. DEFAULT: 10 minutes
Will create a command to execute the script in the directory with the parameter --params 5 and in the current command prompt. The command prompt will be blocked until you stop the script.
Starting a server in a new terminal. You have to specify the port for testing, the other parameters are optional. The startupTime can specify how long the runner will wait for a response from the server process and with interval you can set the frequenzy for the server testing. The path is the subpath from your server that should be reached.
0 commit comments