mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-23 03:41:23 +00:00
37 lines
665 B
Bash
37 lines
665 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
function require() {
|
||
|
if [ "$1" = "" ]; then
|
||
|
echo "input '$2' required"
|
||
|
print_help
|
||
|
exit 1
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
function print_help() {
|
||
|
echo "deploy.sh"
|
||
|
echo ""
|
||
|
echo "Usage:"
|
||
|
echo " deploy.sh [repo] [tag] [arch]"
|
||
|
echo ""
|
||
|
echo "Args:"
|
||
|
echo " repo: The docker repository to publish the image"
|
||
|
echo " tag: The tag applied to the docker image"
|
||
|
echo " arch: The architecuture of the doker image"
|
||
|
}
|
||
|
|
||
|
REPO=$1
|
||
|
TAG=$2
|
||
|
ARCH=$3
|
||
|
|
||
|
require "$REPO" repo
|
||
|
require "$TAG" tag
|
||
|
require "$ARCH" arch
|
||
|
|
||
|
docker build \
|
||
|
--pull \
|
||
|
--build-arg TAG=$TAG \
|
||
|
-t $REPO:$ARCH-$TAG \
|
||
|
-f Dockerfile.$ARCH \
|
||
|
.
|