#!/bin/bash

ROOT=$(pwd)
export VERSION=$(date +%Y%m%d-%H%M)
IMAGE=us-central1-docker.pkg.dev/home-sensors-400805/signaler/image:$VERSION

docker build -f Dockerfile . -t $IMAGE

echo "Done building $IMAGE"

echo -n "Hit enter to deploy"

read

docker push $IMAGE

envsubst < kube/prod.yaml > prod.yaml

kubectl apply -f prod.yaml
