Skip to content

Commit 79efde3

Browse files
committed
Fix gh-pages SRG mapping index page generation and deployment.
1 parent 9454862 commit 79efde3

File tree

2 files changed

+21
-35
lines changed

2 files changed

+21
-35
lines changed

.github/workflows/srg-mapping-table.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,14 @@ jobs:
4646
with:
4747
name: srg-mapping-rhel9.html
4848
path: ${{ env.PAGES_DIR }}/srg-mapping-rhel9.html
49+
- name: Generate HTML pages
50+
run: utils/generate_html_index_srg_mapping.sh $PAGES_DIR "rhel9" # add more products to this list to generate their index
51+
shell: bash
4952
- name: Deploy
5053
if: ${{ github.event_name == 'push' }}
5154
uses: JamesIves/github-pages-deploy-action@v4.2.3
5255
with:
5356
branch: gh-pages # The branch the action should deploy to.
5457
folder: ${{ env.PAGES_DIR }} # The folder the action should deploy.
5558
target-folder: srg_mapping
56-
clean: no
59+
clean: false

utils/generate_html_pages.sh

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,35 @@ fi
1616

1717
PAGES_DIR=$1
1818

19-
mkdir $PAGES_DIR
19+
mkdir -p $PAGES_DIR
2020
STATS_DIR=$PAGES_DIR/statistics
21-
mkdir $STATS_DIR
21+
mkdir -p $STATS_DIR
2222
touch $STATS_DIR/index.html
2323
echo "<html>" > $STATS_DIR/index.html
24-
echo "<header>" >> index.html
25-
echo "<h1>Statistics</h1>" >> index.html
26-
echo "</header>" >> index.html
24+
echo "<head>" >> $STATS_DIR/index.html
25+
echo "<title>Statistics</title>" >> $STATS_DIR/index.html
26+
echo "</head>" >> $STATS_DIR/index.html
27+
echo "<h1>Statistics</h1>" >> $STATS_DIR/index.html
2728
echo "<body>" >> $STATS_DIR/index.html
28-
echo "<ul>" >> $STATS_DIR/index.html
2929
# get supported products
3030
products=$(echo -e "import ssg.constants\nprint(ssg.constants.product_directories)" | python3 | sed -s "s/'//g; s/,//g; s/\[//g; s/\]//g")
3131
for product in $products
3232
do
3333
if [ -d build/$product ]; then
34+
echo "<h4>Product: ${product}</h4>" >> $STATS_DIR/index.html
35+
echo "<ul>" >> $STATS_DIR/index.html
3436
mkdir -p $STATS_DIR/$product
3537
if [ -f build/$product/product-statistics/statistics.html ]; then
3638
cp -rf build/$product/product-statistics $STATS_DIR/$product/product-statistics
37-
echo "<li><a href=\"$product/product-statistics/statistics.html\">Statistics for product: ${product}</a></li>" >> $STATS_DIR/index.html
39+
echo "<li><a href=\"$product/product-statistics/statistics.html\">Product Statistics</a></li>" >> $STATS_DIR/index.html
3840
fi
3941
if [ -f build/$product/profile-statistics/statistics.html ]; then
4042
cp -rf build/$product/profile-statistics $STATS_DIR/$product/profile-statistics
41-
echo "<li><a href=\"$product/profile-statistics/statistics.html\">Profile statistics for product: ${product}</a></li>" >> $STATS_DIR/index.html
43+
echo "<li><a href=\"$product/profile-statistics/statistics.html\">Profile statistics</a></li>" >> $STATS_DIR/index.html
4244
fi
45+
echo "</ul>" >> $STATS_DIR/index.html
4346
fi
4447
done
45-
echo "</ul>" >> $STATS_DIR/index.html
4648
echo "</body>" >> $STATS_DIR/index.html
4749
echo "</html>" >> $STATS_DIR/index.html
4850

@@ -60,9 +62,10 @@ fi
6062
pushd build/tables
6163
touch index.html
6264
echo "<html>" > index.html
63-
echo "<header>" >> index.html
65+
echo "<head>" >> index.html
66+
echo "<title>Mapping Tables</title>" >> index.html
67+
echo "</head>" >> index.html
6468
echo "<h1>Mapping Tables</h1>" >> index.html
65-
echo "</header>" >> index.html
6669
echo "<body>" >> index.html
6770
echo "<ul>" >> index.html
6871
for table in table-*.html
@@ -74,33 +77,13 @@ echo "</body>" >> index.html
7477
echo "</html>" >> index.html
7578
popd
7679

77-
# Generate SRG Mapping Tables
78-
mkdir -p $PAGES_DIR/srg_mapping
79-
pushd $PAGES_DIR/srg_mapping
80-
touch index.html
81-
echo "<html>" > index.html
82-
echo "<header>" >> index.html
83-
echo "<h1>SRG Mapping Tables</h1>" >> index.html
84-
echo "</header>" >> index.html
85-
echo "<body>" >> index.html
86-
echo "<ul>" >> index.html
87-
srg_products="rhel9" # space separated list of products
88-
for product in $srg_products
89-
do
90-
echo "<li><a href=\"srg-mapping-${product}.html\">srg-mapping-${product}.html</a></li>" >> index.html
91-
echo "<li><a href=\"srg-mapping-${product}.xlsx\">srg-mapping-${product}.xlsx</a></li>" >> index.html
92-
done
93-
echo "</ul>" >> index.html
94-
echo "</body>" >> index.html
95-
echo "</html>" >> index.html
96-
popd
97-
9880
pushd $PAGES_DIR
9981
touch index.html
10082
echo "<html>" > index.html
101-
echo "<header>" >> index.html
83+
echo "<head>" >> index.html
84+
echo "<title>Available Artifacts</title>" >> index.html
85+
echo "</head>" >> index.html
10286
echo "<h1>Available Artifacts</h1>" >> index.html
103-
echo "</header>" >> index.html
10487
echo "<body>" >> index.html
10588
echo "<ul>" >> index.html
10689
echo "<li><a href=\"statistics/index.html\">Statistics</a></li>" >> index.html

0 commit comments

Comments
 (0)