commit 5b042bc7a334b4d2fb4638884ba69649187a688e Author: Knut Ahlers Date: Mon Jan 6 21:56:17 2020 +0100 Add infrastructure diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b20f66d --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +export FA_VERSION=5.12.0 + +default: + +assets: + bash ci/bundle_js.sh + bash ci/fontawesome.sh diff --git a/ci/bundle_js.sh b/ci/bundle_js.sh new file mode 100644 index 0000000..aa879e2 --- /dev/null +++ b/ci/bundle_js.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -euxo pipefail + +css_deps=( + # Must-have order + npm/bootstrap@4/dist/css/bootstrap.min.css + npm/bootswatch@4/dist/darkly/bootstrap.min.css + npm/bootstrap-vue@2/dist/bootstrap-vue.min.css + + # Other packages + npm/leaflet@1.5.1/dist/leaflet.min.css +) + +js_deps=( + # Must-have order + npm/vue@2/dist/vue.min.js + npm/bootstrap-vue@2/dist/bootstrap-vue.min.js + + # Other packages + npm/axios@0.19.0/dist/axios.min.js + npm/leaflet@1.5.1/dist/leaflet.min.js + npm/moment@2.24.0/min/moment.min.js +) + +IFS=',' + +curl -sSfLo frontend/combine.js "https://cdn.jsdelivr.net/combine/${js_deps[*]}" +curl -sSfLo frontend/combine.css "https://cdn.jsdelivr.net/combine/${css_deps[*]}" diff --git a/ci/fontawesome.sh b/ci/fontawesome.sh new file mode 100644 index 0000000..dc5da86 --- /dev/null +++ b/ci/fontawesome.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euxo pipefail + +# Ensure deletion of older version +rm -rf frontend/fontawesome + +# Download and unpack fontawesome-free +curl -sSfLo frontend/fa.zip "https://use.fontawesome.com/releases/v${FA_VERSION}/fontawesome-free-${FA_VERSION}-web.zip" +unzip frontend/fa.zip -d frontend +rm frontend/fa.zip + +# Move to generic path +mv frontend/fontawesome-free-${FA_VERSION}-web frontend/fontawesome diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..c6d9f73 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,3 @@ +combine.css +combine.js +fontawesome