Skip to content

Commit

Permalink
add check for running containers
Browse files Browse the repository at this point in the history
  • Loading branch information
karissarjacobsen committed Apr 12, 2024
1 parent 4acad70 commit 326b325
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,16 @@ steps:

- script: dir $(Build.SourcesDirectory)/code-examples-ruby-private

- task: CmdLine@2
inputs:
script: 'docker rm -f $(docker ps -a -q)'
continueOnError: true
- script: |
echo "Checking for running Docker containers..."
containers=$(docker ps -q)
if [ ! -z "$containers" ]; then
echo "Stopping running Docker containers..."
docker stop $(docker ps -q)
else
echo "No Docker containers are running."
fi
displayName: "check for running containers"

- script: |
docker system prune -a --force
Expand Down

0 comments on commit 326b325

Please sign in to comment.