chiark / gitweb /
deployment work
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Nov 2020 22:31:55 +0000 (22:31 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Nov 2020 22:31:55 +0000 (22:31 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile
README.md
src/bin/daemon-otter.rs

index 5946e3f40e86191d1cd2730af462df462cdaa693..a6fe6ea6e4f8cfcf28cb47574ac79f431f61eae6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -78,6 +78,18 @@ $(eval $(call lp,WASM_PACK,wasm-pack,debug,wasm-pack))
 
 PROGRAMS=daemon-otter otter
 
+WASM_ASSETS := $(addprefix otter_wasm,.js _bg.wasm)
+WASM_OUTPUTS := $(addprefix otter_wasm,.d.ts)
+
+TS_SRCS= script
+TS_SRC_FILES= \
+       $(addprefix templates/,$(addsuffix .ts,$(TS_SRCS))) \
+       webassembly-types/webassembly.d.ts \
+       templates/otter_wasm.ns.d.ts
+
+LITFILES= LICENCE AGPLv3
+TXTFILES= CC-BY-SA-3.0 CC-BY-SA-4.0
+
 FILEASSETS = $(addprefix templates/,$(LITFILES) $(TXTFILES))
 
 WASM := wasm32-unknown-unknown
@@ -89,7 +101,7 @@ check: stamp/cargo.check
 
 doc: cargo-doc
 
-debug release:: %: stamp/cargo.% assets extra-%
+debug release:: %: stamp/cargo.% assets libraries extra-%
 
 cargo: cargo-debug cargo-wasm-release
 
@@ -101,7 +113,8 @@ cargo-wasm: cargo-wasm-release
 
 wasm-pack: stamp/wasm-pack
 
-assets: js libraries stamp/wasm-pack $(FILEASSETS)
+assets: js stamp/wasm-pack $(FILEASSETS)
+       : $(FILEASSETS) , $^
 
 js: templates/script.js
 
@@ -137,9 +150,6 @@ stamp/cargo.deploy-build: $(call rsrcs,.)
 
 #---------- wasm ----------
 
-WASM_ASSETS := $(addprefix otter_wasm,.js _bg.wasm)
-WASM_OUTPUTS := $(addprefix otter_wasm,.d.ts)
-
 $(addprefix $(WASM_PACKED)/,$(WASM_ASSETS) $(WASM_OUTPUTS)): stamp/wasm-pack
 stamp/wasm-pack: stamp/cargo.wasm-release
        $(WASM_PACK_CMD) $(WASM_PACK_OPTIONS) build \
@@ -180,15 +190,6 @@ $(LIBRARY_FILES): $(USVG_PROCESSOR) $(USVG_BINARY) Makefile
 
 #---------- typescript ----------
 
-TS_SRCS= script
-TS_SRC_FILES= \
-       $(addprefix templates/,$(addsuffix .ts,$(TS_SRCS))) \
-       webassembly-types/webassembly.d.ts \
-       templates/otter_wasm.ns.d.ts
-
-LITFILES= LICENCE AGPLv3
-TXTFILES= CC-BY-SA-3.0 CC-BY-SA-4.0
-
 templates/%.js: tsc-wrap tsconfig.json
        ./tsc-wrap $@ tsconfig.json $(filter %.ts,$^)
 
@@ -213,7 +214,7 @@ templates/otter_wasm.ns.d.ts: $(WASM_PACKED)/otter_wasm.d.ts \
 
 #---------- other templates ----------
 
-$(addprefix templates/,$(LITFILES)): templates/%: %;
+$(addprefix templates/,$(LITFILES)): templates/%: %
        cp $< $@.new && mv -f $@.new $@
 
 $(addprefix templates/,$(TXTFILES)): templates/%: %.txt
@@ -225,9 +226,15 @@ libraries: $(LIBRARY_FILES)
 
 DEPLOY_BASE=ian@login.chiark.greenend.org.uk:/volatile/Otter
 
-deploy: stamp/cargo.deploy-build bundled-sources
+deploy: stamp/cargo.deploy-build bundled-sources assets libraries
        rsync -zv --progress $(addprefix $(DEPLOY_TARGET_DIR)/,$(PROGRAMS)) $(DEPLOY_BASE)/bin/
        rsync -rv --progress $(TARGET_DIR)/bundled-sources/. $(DEPLOY_BASE)/bundled-sources
+       rsync -rv --progress README.md $(DEPLOY_BASE)/.
+       rsync -rv --progress --delete --exclude=\*~ library/. $(DEPLOY_BASE)/library/.
+       rsync -rv --progress $(FILEASSETS) $(addprefix $(WASM_PACKED)/, $(WASM_ASSETS)) \
+               $(DEPLOY_BASE)/assets/
+
+#$(DEPLOY_BASE)/bundled-sources
 
 #---------- clean ----------
 
index 0d4de2a7e1fed9e8ef1b53586b045860d38421f9..814ce5de8ade4a2322505712427e34f8816ac487 100644 (file)
--- a/README.md
+++ b/README.md
@@ -11,3 +11,17 @@ unix shell account on the server.
 Right now Otter is in an alpha state.
 
 
+BUILDING
+========
+
+Otter is not so easy to build.  You will want to start with the git
+branch
+  https://salsa.debian.org/iwj/otter
+
+You cannot build it just with `cargo`, you must use `make`.
+
+You will also need various other utilities and dependencies - in some
+cases, un-released dependencies or locally patched versions.  See
+`Cargo.nail` and `Makefile`.  On my own laptop deployment is done with
+`make deploy` which copies all the relevant sources into the
+`bundled-sources` directory, which is accessible via the Otter web UI.
index 76104cc8b4a71223b05ea10b0f9dbe2914739f9c..f4f868d132b7386936c430540a608ef1ba7381a9 100644 (file)
@@ -26,7 +26,6 @@ type RL = ResourceLocation;
 
 const RESOURCES : &[(&'static str, ResourceLocation, ContentType)] = &[
   ("script.js",    RL::Main,                       ContentType::JavaScript),
-  ("style.css",    RL::Main,                       ContentType::JavaScript),
   ("LICENCE",      RL::Main,                       ContentType::Plain),
   ("libre",        RL::Main,                       ContentType::HTML),
   ("AGPLv3",       RL::Main,                       ContentType::Plain),