#!/usr/bin/env sh

cd "$(realpath $(dirname $0))"

IMAGE=registry.tirefireind.us/arrdem/activitypub_relay

docker build -t $IMAGE:latest -t relay .
docker push $IMAGE:latest
ssh root@relay.tirefireind.us systemctl restart activitypub-relay

if [ -n "$TAG" ]; then
    for stem in registry.tirefireind.us/arrdem/activitypub_relay registry.digitalocean.com/macawsocial/relay; do
        docker tag relay "$stem:$TAG"
        docker push $stem:"$TAG"
    done
fi
