forked from ComplianceAsCode/content
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix gh-pages SRG mapping index page generation and deployment.
- Loading branch information
Showing
3 changed files
with
67 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
# suppress stdout from pushd and popd commands | ||
pushd () { | ||
command pushd "$@" > /dev/null | ||
} | ||
|
||
popd () { | ||
command popd "$@" > /dev/null | ||
} | ||
|
||
if [ -z "$1" ]; then | ||
echo "You must inform a directory to store built files." | ||
exit 1 | ||
fi | ||
PAGES_DIR=$1 | ||
|
||
if [ -z "$2" ]; then | ||
echo "You must inform a list of products in double quotes." | ||
exit 1 | ||
fi | ||
srg_products=$2 # space separated list of products | ||
|
||
mkdir -p $PAGES_DIR | ||
|
||
# Generate SRG Mapping Tables | ||
pushd $PAGES_DIR | ||
touch index.html | ||
echo "<html>" > index.html | ||
echo "<head>" >> index.html | ||
echo "<title>SRG Mapping Tables</title>" >> index.html | ||
echo "</head>" >> index.html | ||
echo "<h1>SRG Mapping Tables</h1>" >> index.html | ||
echo "<body>" >> index.html | ||
for product in $srg_products | ||
do | ||
echo "<h4>Product: ${product}</h4>" >> index.html | ||
echo "<ul>" >> index.html | ||
echo "<li><a href=\"srg-mapping-${product}.html\">srg-mapping-${product}.html</a></li>" >> index.html | ||
echo "<li><a href=\"srg-mapping-${product}.xlsx\">srg-mapping-${product}.xlsx</a></li>" >> index.html | ||
echo "</ul>" >> index.html | ||
done | ||
echo "</body>" >> index.html | ||
echo "</html>" >> index.html | ||
popd | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters