Resources attached to the Road To DevOps tutorial
https://blog.noobtoroot.xyz/road-to-devops/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
758 B
28 lines
758 B
2 years ago
|
#!/bin/bash
|
||
|
#
|
||
|
# Convert Reveal.js slides found in sub-directories.
|
||
|
#
|
||
|
# requires:
|
||
|
# Docker-Engine to be installed and running
|
||
|
# Docker 'astefanutti/decktape' image to be installed or downloadable
|
||
|
|
||
|
if ! docker info >/dev/null ; then
|
||
|
echo "Error: Seems that Docker-Engine is not running..." >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
current_local_dir="$(pwd)"
|
||
|
|
||
|
for directory in $(find "$current_local_dir" -maxdepth 1 -type d)
|
||
|
do
|
||
|
for file in "$directory"/*.html
|
||
|
do
|
||
|
file_path="$(basename "$directory")/$(basename "$file")"
|
||
|
docker run --rm \
|
||
|
-t \
|
||
|
-v "$current_local_dir":/slides \
|
||
|
-v "$current_local_dir"/:/home/user \
|
||
|
astefanutti/decktape:1.0.0 /home/user/"$file_path" "$(basename "$file")".pdf
|
||
|
done
|
||
|
done
|