From: Ian Jackson Date: Sat, 21 Nov 2020 22:31:55 +0000 (+0000) Subject: deployment work X-Git-Tag: otter-0.2.0~417 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3d26ecf1a7e07976a1b424e11cf3a7ba65d24417;p=otter.git deployment work Signed-off-by: Ian Jackson --- diff --git a/Makefile b/Makefile index 5946e3f4..a6fe6ea6 100644 --- 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 ---------- diff --git a/README.md b/README.md index 0d4de2a7..814ce5de 100644 --- 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. diff --git a/src/bin/daemon-otter.rs b/src/bin/daemon-otter.rs index 76104cc8..f4f868d1 100644 --- a/src/bin/daemon-otter.rs +++ b/src/bin/daemon-otter.rs @@ -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),