Skip to content

Commit 394b70a

Browse files
Update azure-pipelines.yml for Azure Pipelines
1 parent 1786810 commit 394b70a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

azure-pipelines.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,16 @@ steps:
7575
cp $(node_private_key.secureFilePath) code-examples-node-private/config/private.key
7676
displayName: 'place private.key'
7777

78-
- task: CmdLine@2
79-
inputs:
80-
script: 'docker rm -f $(docker ps -a -q)'
81-
continueOnError: true
78+
- script: |
79+
echo "Checking for running Docker containers..."
80+
containers=$(docker ps -q)
81+
if [ ! -z "$containers" ]; then
82+
echo "Stopping running Docker containers..."
83+
docker stop $(docker ps -q)
84+
else
85+
echo "No Docker containers are running."
86+
fi
87+
displayName: "check for running containers"
8288

8389
- script: |
8490
docker system prune -a --force

0 commit comments

Comments
 (0)