#!/bin/sh
# RUN IN REPO ROOT DIR !!

export IMAGE_PREFIX="git.ego.freeddns.org/egommerce/identity"
export SERVER_IMAGE="$IMAGE_PREFIX-svc"

TARGET=${1:-latest}

echo $DOCKER_PASSWORD | docker login git.ego.freeddns.org -u $DOCKER_USERNAME --password-stdin

docker push "$SERVER_IMAGE:$TARGET"

# Restart container
curl -X POST http://127.0.0.1:9001/api/webhooks/64ea5d78-ae21-474c-ad4d-1d98f6b83acb
