Skip to content

Commit 56614f5

Browse files
committed
Added breakfix template and modified course-init script to use it
1 parent ca1641f commit 56614f5

19 files changed

+201
-41
lines changed

course-init.sh

+76-41
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,108 @@
1-
## Get the training repository name and replace it with the placeholder string in different files
2-
REPONAME=$(basename `git rev-parse --show-toplevel`)
3-
echo -ne "Initializing $REPONAME . . . "
4-
sed -i "s/REPLACEREPONAME/${REPONAME}/g" *.* > /dev/null 2>&1
5-
sed -i "s/REPLACEREPONAME/${REPONAME}/g" supplemental-ui/partials/header-content.hbs > /dev/null 2>&1
6-
echo -e "done"
7-
8-
mv -f README-TRAINING.md README.md
9-
10-
## Automation required for repo customization (like for example TYPE hol or bfx LAB demo or role or other) goes here.
111
print_usage()
122
{
133
echo -e """
144
USAGE: $0 --type [hol|bfx] --lab [demo|role|other]
15-
DEFAULT: $0 --type hol --lab demo
165
"""
176
return
187
}
8+
9+
exit_script()
10+
{
11+
#cleanup
12+
echo -e "\nPlease replace the FIXME string in the antora.yml file below and commit the changes before proceeding with the course development."
13+
grep FIXME antora.yml
14+
}
15+
1916
handle_lab()
2017
{
21-
case "$1" in
22-
"demo"|"role"|"other" )
23-
LAB=$(echo $1)
24-
;;
25-
* )
26-
print_usage
27-
exit 1
28-
;;
29-
esac
18+
cp -f modules/LABENV/pages/index-lab-$LAB.adoc modules/LABENV/pages/index.adoc
3019
}
20+
3121
handle_type()
3222
{
33-
case "$1" in
34-
"hol"|"bfx" )
35-
TYPE=$(echo $1)
23+
case "$TYPE" in
24+
"hol" )
25+
rm -rf modules.bfx
26+
;;
27+
"bfx" )
28+
rm -rf modules
29+
mv modules.bfx modules
3630
;;
3731
* )
32+
echo -e "ERROR: you should never land here"
3833
print_usage
3934
exit 1
4035
;;
4136
esac
4237
}
38+
4339
execute_init()
4440
{
45-
echo -e "Initializing type to $TYPE and lab to $LAB "
46-
mv -f modules/LABENV/pages/index-lab-$LAB.adoc modules/LABENV/pages/index.adoc
47-
echo -e "TODO: Handling course type is not implemented yet"
48-
exit 0
41+
## Get the training repository name and replace it with the placeholder string in different files
42+
handle_type
43+
handle_lab
44+
REPONAME=$(basename `git rev-parse --show-toplevel`)
45+
echo -ne "Initializing $REPONAME . . . "
46+
sed -i "s/course-starter-template/${REPONAME}/g" *.* > /dev/null 2>&1
47+
sed -i "s/course-starter-template/${REPONAME}/g" supplemental-ui/partials/header-content.hbs > /dev/null 2>&1
48+
echo -e "done"
49+
50+
mv -f README-TRAINING.md README.md
51+
}
52+
53+
validate_args()
54+
{
55+
case "$LAB" in
56+
"demo"|"role"|"other" )
57+
;;
58+
* )
59+
echo -e "ERROR: Invalid lab type: $LAB"
60+
print_usage
61+
exit 1
62+
;;
63+
esac
64+
case "$TYPE" in
65+
"hol"|"bfx" )
66+
;;
67+
* )
68+
echo -e "ERROR: Invalid course type: $TYPE"
69+
print_usage
70+
exit 1
71+
;;
72+
esac
73+
execute_init
74+
echo -e "Initialized type to $TYPE and lab to $LAB "
75+
exit_script
76+
}
77+
78+
cleanup()
79+
{
80+
# Clean unused files for lab type
81+
rm -f modules/LABENV/pages/index-*.adoc
82+
# Clean unused files for course type
83+
# Remove this script
84+
rm -f $0
4985
}
86+
87+
## Start by validating provided options and initializing variables for arguments
88+
if [ $# -lt 4 ]
89+
then
90+
echo -e "ERROR: Insufficient arguments"
91+
print_usage
92+
exit 1
93+
fi
94+
5095
for arg in "$@"
5196
do
5297
case ${arg} in
5398
"--lab" )
5499
shift
55-
handle_lab $1
100+
LAB=$(echo $1)
56101
shift
57102
;;
58103
"--type" )
59104
shift
60-
handle_type $1
105+
TYPE=$(echo $1)
61106
shift
62107
;;
63108
"--help" )
@@ -66,17 +111,7 @@ do
66111
;;
67112
esac
68113
done
69-
execute_init
70114

71-
#cleanup()
72-
echo -e "\nPlease replace the specified strings in the files below and commit the changes before proceeding with the course development."
73-
grep FIXME *.*
115+
validate_args
116+
74117

75-
cleanup()
76-
{
77-
# Clean unused files for lab type
78-
rm -f modules/LABENV/pages/index-*.adoc
79-
# Clean unused files for course type
80-
# Remove this script
81-
rm -f $0
82-
}

images/sample-image.png

2.6 KB
Loading

modules.bfx/LABENV/nav.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* xref:index.adoc[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= Lab Environment
2+
3+
FIXME: Instructions for accessing the lab environment on the Demo platform, for this hands-on based training.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= Lab Environment
2+
3+
FIXME: Instructions for accessing the lab environment on any other platform, for this hands-on based training.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= Lab Environment
2+
3+
FIXME: Instructions for accessing the lab environment on the ROLE platform, for this hands-on based training.

modules.bfx/LABENV/pages/index.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= Lab Environment
2+
3+
FIXME: Instructions for accessing the lab environment on the Demo platform, for this hands-on based training.

modules.bfx/ROOT/nav.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* xref:index.adoc[]

modules.bfx/ROOT/pages/index.adoc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
= An Example Quick Course
2+
:navtitle: Home
3+
4+
== Introduction
5+
6+
This is an example quick course demonstrating the usage of Antora for authoring and publishing quick courses.

modules.bfx/appendix/nav.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* xref:appendix.adoc[]
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= Appendix
2+
3+
Content for Appendix...

modules.bfx/chapter1/nav.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* xref:index.adoc[]
2+
** xref:USAGEGUIDE.adoc[]
3+
** xref:section1.adoc[]
4+
** xref:section2.adoc[]

modules.bfx/chapter1/pages/index.adoc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
= What’s in this break-fix?
2+
3+
== In this break-fix:
4+
5+
**Type of issue:**
6+
7+
FIXME: Describe an issue type/category that this specific issue falls into, like, "A Red Hat Enterprise Linux 7 system won't boot after a kernel update." Save issue-specific details for the break-fix scenario page.
8+
9+
10+
11+
**What you should already know:**
12+
13+
FIXME: This training assumes that you are a Red Hat Certified System Administrator (RHCSA) or have equivalent experience administrating Red Hat Enterprise Linux 7 or 8. FIXME - update this as needed
14+
15+
16+
**How break-fix training works:**
17+
18+
. Challenge yourself in the break-fix activity. It describes a problem scenario that's simulated in the lab environment where you can investigate and solve the problem.
19+
. Follow up with the guided solution:
20+
.. If you weren't able to solve the problem on your own, read and follow the instructions in the Guided Solution to complete this training.
21+
.. If you were successful in solving the problem, read the solution for useful tips you can apply when solving similar problems.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
= Break-fix activity
2+
3+
This section presents a scenario based on a real customer issue.
4+
5+
. Read the scenario and success criteria.
6+
. Follow any instructions provided for setting up your lab environment.
7+
. Resolve the issue as simulated in your lab environment.
8+
. After resolving the issue, run the grading script and submit the completion code as prompted.
9+
10+
11+
**You must successfully complete this section to receive a passing grade for this module.**
12+
13+
14+
If you exhaust your experience and resources, and you're unable to solve the issue on your own, use the guided solution to step through one possible solution, with tips for addressing similar issues.
15+
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
= Check your work
2+
3+
== Follow below steps in the lab to check your work
4+
5+
FIXME: Add the instructions to be followed in the lab environment to make sure the problem has been resolved. You may chose to remove this block if grading script is provided in the lab to check the work.
6+
7+
== Check your work using the grading script
8+
9+
After you have resolved the issue and met the success criteria, login to `FIXME` system as `FIXME` user and run the grading script as shown here to check your work:
10+
11+
[source,bash,role=execute]
12+
----
13+
break-fix-script grade
14+
----
15+
16+
.Sample output
17+
----
18+
[root@classroom ~]# break-fix-script grade
19+
Initiating break-fix-script with option grade
20+
Grading. Please wait.
21+
Success.
22+
COMPLETION CODE: <check your output for this value>
23+
Completed break-fix-script with option grade successfully
24+
----
25+
26+
FIXME: Remove the below block if no grading script is provided to check the work in the break-fix activity. In this case make sure you use the above block to provide step-by-step instructions learner can follow to check their work.
27+
28+
== Submit the completion code
29+
30+
NOTE: Skip this if not applicable for you.
31+
32+
- For RedHat internal audience: Submit that completion code https://link-to-appropriate-lms.com[here,window=_blank] to receive a grade for this training
33+
- For RedHat partners: Submit that completion code https://link-to-appropriate-lms.com[here,window=_blank] to receive a grade for this training
34+
35+
FIXME: Change the links in the above lines to the link for appropriate audience specific LMS where learner can provide completion code. Remove this block if submitting completion is not applicable.

modules.bfx/chapter2/nav.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* xref:index.adoc[]
2+
** xref:section1.adoc[]
3+
** xref:section2.adoc[]

modules.bfx/chapter2/pages/index.adoc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
= Guided solution
2+
3+
This section presents a guided solution to the break-fix activity.
4+
5+
Use this section to:
6+
7+
Learn one possible path to resolving the issue.
8+
9+
Get some tips for investigating and resolving similar issues.
10+
11+
12+
If you're still stuck after exhausting your expertise and resources on the break-fix activity:
13+
14+
Use this solution to complete the activity.
15+
Check your work when you finish to receive a grade for this activity.
16+
17+
NOTE: The steps detailed in these solution pages are optional. They provide additional guidance for those struggling with the break-fix activity. We encourage you to only use these pages if you are completely stuck in solving the issue
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= Guided solution (page 1 of 2)
2+
3+
FIXME: Provide step-by-step instructions here to resolve the issue.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= Guided solution (page 2 of 2)
2+
3+
FIXME: Provide step-by-step instructions here to resolve the issue.

0 commit comments

Comments
 (0)