From 2d781a7f5251bde06da0b3e9f91eaa688839ba13 Mon Sep 17 00:00:00 2001 From: Oliver Marks Date: Tue, 24 Sep 2019 20:58:35 +0100 Subject: [PATCH] Fix up drone build file. --- .drone.yml | 6 +++--- prod.cljs.edn | 2 +- resources/public/dev-main.js | 12 ------------ src/weecfg/core.cljs | 3 ++- 4 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 resources/public/dev-main.js diff --git a/.drone.yml b/.drone.yml index 4310c84..f7b6ec6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,11 +12,11 @@ steps: - name: compress image: alpine commands: - - ls -la - apk add gzip - cd /drone/src/resources/public/ - - rm /drone/src/resources/public/*.gz - - rm /drone/src/resources/public/webfonts/*.gz + - rm -f /drone/src/resources/public/*.js + - rm -f /drone/src/resources/public/*.gz + - rm -f /drone/src/resources/public/webfonts/*.gz - gzip *.css *.js *.html *.png -k - gzip ./webfonts/*.woff2 -k - tar -czvf release.tar.gz *.gz ./webfonts/*.gz diff --git a/prod.cljs.edn b/prod.cljs.edn index 93b4c86..822bca3 100644 --- a/prod.cljs.edn +++ b/prod.cljs.edn @@ -1,3 +1,3 @@ {:output-to "resources/public/main.js" -:optimizations :advanced + :optimizations :advanced :main weecfg.core} diff --git a/resources/public/dev-main.js b/resources/public/dev-main.js deleted file mode 100644 index a914af8..0000000 --- a/resources/public/dev-main.js +++ /dev/null @@ -1,12 +0,0 @@ -var CLOSURE_UNCOMPILED_DEFINES = {"figwheel.repl.connect_url":"ws:\/\/localhost:9500\/figwheel-connect?fwprocess=839c36&fwbuild=dev"}; -var CLOSURE_NO_DEPS = true; -if(typeof goog == "undefined") document.write(''); -document.write(''); -document.write(''); -document.write(''); -document.write(''); -document.write(''); -document.write(''); -document.write(''); -document.write(''); -document.write(''); diff --git a/src/weecfg/core.cljs b/src/weecfg/core.cljs index df23e51..b0f51e5 100644 --- a/src/weecfg/core.cljs +++ b/src/weecfg/core.cljs @@ -12,12 +12,13 @@ (defonce form-title (atom "GASP Sensor setup")) (defonce form-data (atom {:server "" :device-id "" :wifi-ssid "" :wifi-key ""})) (defonce device-id-regex #"[A-Za-z0-9]{4}") +(defonce alpha-numeric-regex #"[A-Za-z0-9]") (defonce ssid-regex #"^[!#;].|[+\[\]\"\t\s].*$") ; spec validation definitions (s/def ::boolean-type boolean?) (s/def ::integer-type int?) -(s/def ::size-test #(<= (count %) 2)) +(s/def ::alpha-numeric-type (s/and string? #(re-matches alpha-numeric-regex %))) (s/def ::ssid-size-limit #(<= (count %) 32)) (s/def ::default-size-limit #(<= (count %) 50)) (s/def ::wifi-ssid-type (s/and string? #(re-matches ssid-regex %) ::ssid-size-limit))