diff --git a/.woodpecker.yml b/.woodpecker.yml index 784a5ec..2979ebd 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -37,7 +37,7 @@ pipeline: - nginx.conf - version.txt - webserver-deploy: + webserver-deploy: image: appleboy/drone-ssh settings: host: @@ -51,7 +51,7 @@ pipeline: - cd /home/mnisyif/docker-containers/mnisyif/frontend - VERSION=$(cat version.txt) # Build the new Docker image with the current version tag - - docker build -t frontend:$VERSION . + - docker build -t frontend:$VERSION . || { echo "Docker build failed"; exit 1; } # Stop and remove the existing container if it exists - docker stop frontend || true - docker rm frontend || true @@ -63,9 +63,9 @@ pipeline: - docker system prune -f --volumes # Remove older versions of the Docker image - > - for img in $(docker images frontend --format "{{.Tag}}" | grep -v $VERSION); do - docker rmi frontend:$img; - done + for img in $(docker images frontend --format "{{.Tag}}" | grep -v $VERSION); do + docker rmi frontend:$img || true; + done trigger: event: