35 lines
707 B
Bash
Executable File
35 lines
707 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
if (( $# != 1 )); then
|
|
echo "usage: ssh deploy@riju IMAGE" >&2
|
|
exit 1
|
|
fi
|
|
|
|
image="$1"
|
|
|
|
riju-init-volume
|
|
|
|
echo "Pull image to be deployed..."
|
|
docker pull "${image}"
|
|
|
|
echo "Start new image in test container..." >&2
|
|
CONTAINER_NAME=riju-test IMAGE_NAME="${image}" DETACH=1 \
|
|
PORT_MAPPING="-p 127.0.0.1:6119:6119" riju
|
|
|
|
echo "Wait for web server to come up..." >&2
|
|
sleep 5
|
|
|
|
echo "Test web server health..." >&2
|
|
curl -fsSL http://localhost:6119 | head -n15
|
|
|
|
echo "Tear down test container..." >&2
|
|
docker stop riju-test
|
|
|
|
echo "Retag production image..." >&2
|
|
docker tag "${image}" riju:app
|
|
|
|
echo "Restart production server..." >&2
|
|
systemctl restart riju
|