/
Makefile
46 lines (34 loc) · 972 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ifdef DEBUG
SPINFLAGS = WASMTIME_BACKTRACE_DETAILS=1
SPINFLAGS += RUST_LOG=spin=trace
endif
ifndef SPINCFG
SPINCFG = spin.toml
endif
ifndef SPINVER
SPINVER = v0.8.0
endif
ifndef ARCH
ARCH = amd64
endif
ifndef OS
OS = linux
endif
ifndef SPINBIN
SPINBIN = https://github.com/fermyon/spin/releases/download/$(SPINVER)/spin-$(SPINVER)-$(OS)-$(ARCH).tar.gz
endif
.PHONY: run watch container
all: run
build:
spin build --from $(SPINCFG)
run: build
$(SPINFLAGS) spin up -f $(SPINCFG)
watch: build
nodemon --watch cgi-bin --watch . --ext pl,html,wasm,toml --verbose --legacy-watch --signal SIGINT --exec '$(SPINFLAGS) spin up --file $(SPINCFG)'
container: build
nixpacks build . --name php --pkgs wget curl \
--install-cmd 'wget -O spin.tar.gz $(SPINBIN) && tar xvf spin.tar.gz && (curl https://get.wasmer.io -sSfL | sh)' \
--build-cmd './spin build' \
--start-cmd './spin up --file spin.toml'
oci:
$(SPINFLAGS) spin oci push ghcr.io/guregu/php:v0.0.1-test1