2021-01-12 11:47:06 +03:00
|
|
|
.PHONY: build-backend build-octo-cli build-frontend docs backend-docs frontend-docs repl shell shell-ghcjs ghcid ghcid-cli ghcid-frontend push-octopod run-backend-dev run-frontend-dev
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
build-backend:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-build . -A ghc.octopod-backend -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
build-octo-cli:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-build . -A ghc.octo-cli -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
build-frontend:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-build . -A ghcjs.octopod-frontend -o frontend-result -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
docs: backend-docs frontend-docs
|
|
|
|
|
|
|
|
backend-docs:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-build . -A ghc.octopod-backend.doc -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
frontend-docs:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-build . -A ghcjs.octopod-frontend.doc -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
repl:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-shell . -A shells.ghc --run "cabal repl lib:octopod-backend" -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
shell:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-shell . -A shells.ghc -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
shell-ghcjs:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-shell . -A shells.ghcjs -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
ghcid-backend:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-shell . -A shells.ghc --run 'ghcid -c "cabal new-repl octopod-backend"' -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
ghcid-cli:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-shell . -A shells.ghc --run 'ghcid -c "cabal new-repl octo-cli"' -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
ghcid-frontend:
|
2021-01-12 12:23:14 +03:00
|
|
|
nix-shell . -A shells.ghc --run 'ghcid -c "cabal new-repl octopod-frontend -fdevelopment --ghc-options=-Wwarn" --warnings --test 'Main.main'' -j auto
|
2020-12-09 16:20:24 +03:00
|
|
|
|
|
|
|
push-octopod:
|
|
|
|
./build.sh build-and-push latest
|
2021-01-12 11:47:06 +03:00
|
|
|
|
|
|
|
run-backend-dev: dev/certs/server_cert.pem dev/certs/server_key.pem
|
|
|
|
./dev/dev_backend.sh `nix-build . -A ghc.octopod-backend`
|
|
|
|
|
|
|
|
run-frontend-dev: build-frontend
|
|
|
|
caddy run
|
|
|
|
|
|
|
|
dev/certs/server_cert.pem dev/certs/server_key.pem:
|
|
|
|
openssl req -x509 -newkey rsa:4096 -keyout dev/certs/server_key.pem -out dev/certs/server_cert.pem -nodes -subj "/CN=localhost/O=Server"
|
|
|
|
|
|
|
|
dev/certs/client_csr.pem dev/certs/client_key.pem:
|
|
|
|
openssl req -newkey rsa:4096 -keyout dev/certs/client_key.pem -out dev/certs/client_csr.pem -nodes -subj "/CN=Client"
|
|
|
|
|
|
|
|
dev/certs/client_cert.pem: dev/certs/client_csr.pem dev/certs/server_cert.pem dev/certs/server_key.pem
|
|
|
|
openssl x509 -req -in dev/certs/client_csr.pem -CA dev/certs/server_cert.pem -CAkey dev/certs/server_key.pem -out dev/certs/client_cert.pem -set_serial 01 -days 3650)
|