Skip to content

Commit

Permalink
yegor256#594 handle case when docker run fails
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyk authored and krzyk committed Oct 26, 2014
1 parent 559fd9c commit 6839250
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/resources/com/rultor/agents/req/_head.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ function docker_when_possible {
use_image="${image}"
docker pull "${use_image}"
fi
docker run --rm -v "$(pwd):/main" "${vars[@]}" \
if docker run --rm -v "$(pwd):/main" "${vars[@]}" \
--memory=4g "--cidfile=$(pwd)/cid" -w=/main \
--name="${talk}" "${image}" /main/entry.sh
if [ -n "${directory}" ]; then
docker rmi "${use_image}"
--name="${talk}" "${image}" /main/entry.sh \
|| true; then
if [ -n "${directory}" ]; then
docker rmi "${use_image}"
fi
fi
sudo chown -R $(whoami) repo
cd repo
Expand Down

0 comments on commit 6839250

Please sign in to comment.