about summary refs log tree commit diff
path: root/deploy.sh
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-06-06 15:27:01 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-06-06 15:27:01 +0200
commitc53665cbeff362c8bed7da998007c1b0519f8d2b (patch)
tree426525772c73eeeb7444a3223fcae6eb514ed9af /deploy.sh
downloadsprzet-c53665cbeff362c8bed7da998007c1b0519f8d2b.tar.gz
sprzet-c53665cbeff362c8bed7da998007c1b0519f8d2b.zip
Init
Diffstat (limited to 'deploy.sh')
-rwxr-xr-xdeploy.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh
new file mode 100755
index 0000000..60b343d
--- /dev/null
+++ b/deploy.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+mkdir -p dest
+
+cat > dest/index.html <<EOF
+<!doctype html>
+<html lang="pl">
+  <head>
+    <title>Sprzęt 19PDH Puszcza</title>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1">
+    <style>
+body {
+  margin: 0 auto;
+  font-family: sans-serif;
+  max-width: 80ex;
+  box-sizing: border-box;
+  padding: 1ex;
+}
+img {
+  width: 80%;
+  margin-left: 10%;
+}
+</style>
+  </head>
+  <body>
+    <h1>Sprzęt 19PDH Puszcza</h1>
+    <h2>Zastępy</h2>
+    <ul>
+EOF
+
+cat > dest/index.gmi <<EOF
+# Sprzęt 19PDH Puszcza
+
+EOF
+
+for f in `find zastępy -name '*.csv'`; do
+  name=$(basename $f .csv)
+  ./report.sh $name > dest/$name.pdf
+  echo "<li><a href="$name.pdf">$name</a></li>" >> dest/index.html
+  echo "=> $name.pdf $name" >> dest/index.gmi
+done
+
+cat >> dest/index.html <<EOF
+  </body>
+</html>
+EOF
+
+rsync -aP ./dest/ srv1:/srv/www/zhr.niedzwiedzinski.cyou/sprzet