Skip to content

Commit

Permalink
Update azure-pipelines.yml for Azure Pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiago2436 committed Oct 31, 2023
1 parent 5f32c9c commit 10e0306
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@ stages:
name: Default
vmImage: ubuntu-latest
steps:
- script: |
echo "Parando o contêiner antigo..."
docker stop $(docker ps -q --filter ancestor=thiagomartinsemartins/deskflora) || true
echo "Removendo o contêiner antigo..."
docker rm $(docker ps -aq --filter ancestor=thiagomartinsemartins/deskflora) || true
echo "Puxando a nova imagem do Docker Hub..."
docker pull thiagomartinsemartins/deskflora:$(tag)
echo "Iniciando o novo contêiner..."
docker run -d -p 8080:80 thiagomartinsemartins/deskflora:$(tag)
displayName: 'Implantar no servidor'
- script: |
PORT=8080
if sudo lsof -Pi :$PORT -sTCP:LISTEN -t >/dev/null; then
echo "Port $PORT is already in use."
PID=$(sudo lsof -t -i:$PORT)
echo "Killing the process using port $PORT..."
sudo kill -9 $PID
fi
echo "Parando o contêiner antigo..."
docker stop $(docker ps -q --filter ancestor=thiagomartinsemartins/deskflora) || true
echo "Removendo o contêiner antigo..."
docker rm $(docker ps -aq --filter ancestor=thiagomartinsemartins/deskflora) || true
echo "Puxando a nova imagem do Docker Hub..."
docker pull thiagomartinsemartins/deskflora:$(tag)
echo "Iniciando o novo contêiner..."
docker run -d -p $PORT:80 thiagomartinsemartins/deskflora:$(tag)
displayName: 'Deploy container'

0 comments on commit 10e0306

Please sign in to comment.