cuddle-rust-service-plan/scripts/run_release.sh

21 lines
339 B
Bash
Raw Normal View History

2022-08-11 01:05:47 +02:00
#!/bin/bash
2022-08-11 01:09:16 +02:00
set -e
2022-08-11 01:05:47 +02:00
echo "prebuiliding docker image"
2022-08-11 01:06:24 +02:00
cuddle_cli x build_release
2022-08-11 01:05:47 +02:00
echo "running docker image"
2022-08-11 01:24:26 +02:00
tag="$REGISTRY/$SERVICE:${COMMIT_SHA:0:10}"
2022-08-11 01:05:47 +02:00
2022-08-11 01:11:25 +02:00
container_id=$(docker run -d "$tag")
2022-08-11 01:05:47 +02:00
2022-08-11 01:11:25 +02:00
sleep 5s
2022-08-11 01:05:47 +02:00
2022-08-11 01:11:25 +02:00
docker logs "$container_id"
2022-08-11 01:12:56 +02:00
echo "removing image"
docker stop "$container_id" > /dev/null && docker rm "$container_id" > /dev/null