IMAGE_REPOSITORY := "rancherlabs/eio-ghosts"
IMAGE_VERSION    := "0.1.0"

build-local:
  cargo build

build-image:
  docker build --tag {{ IMAGE_REPOSITORY }}:{{ IMAGE_VERSION }} .

publish-image: build-image
  docker push {{ IMAGE_REPOSITORY }}:{{ IMAGE_VERSION }}

run-local:
  cargo run

run-container: build-image
  docker run --rm -it --publish 8000:8000 {{ IMAGE_REPOSITORY }}:{{ IMAGE_VERSION }}

test-live:
  curl --fail http://127.0.0.1/v1/encrypt --data @test.json

deploy namespace="github-rancher-eio":
  kubectl apply --namespace={{ namespace }} --filename=manifest.yaml

undeploy namespace="github-rancher-eio":
  kubectl delete --namespace={{ namespace }} --filename=manifest.yaml
