#!/bin/bash
set -e

VERSION=${1:-latest}

docker build -t gitlab.scientificnet.org:4567/commul/dspace/dspace-image:$VERSION . -f Dockerfile.dspace
docker build -t gitlab.scientificnet.org:4567/commul/dspace/nginx-image:$VERSION . -f Dockerfile.nginx
docker build -t gitlab.scientificnet.org:4567/commul/dspace/postgres-image:$VERSION . -f Dockerfile.psql

docker push gitlab.scientificnet.org:4567/commul/dspace/dspace-image:$VERSION
docker push gitlab.scientificnet.org:4567/commul/dspace/nginx-image:$VERSION
docker push gitlab.scientificnet.org:4567/commul/dspace/postgres-image:$VERSION

