Skip to content

Commit

Permalink
feat: force rebuild for deploy commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Nov 28, 2022
1 parent e957dda commit 3acee08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v0.9.0 (2022-11-27)

- Force recreating containers even if config or images haven't changed

## v0.8.0 (2022-05-27)

- Attempts to start Traefik before other services on `deploy_all` command
Expand Down
10 changes: 5 additions & 5 deletions src/srvinfra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ deploy() {
docker compose -f docker-compose.yml up -d --build
elif [[ "$1" = "website" ]]; then
cd "$SRVINFRA_WEBSITES_DIR"/"$2" || exit 1
docker compose -f docker-compose.yml -f docker-compose-prod.yml up -d --build --quiet-pull
docker compose -f docker-compose.yml -f docker-compose-prod.yml up -d --build --force-recreate --quiet-pull
else
echo "$1 isn't a valid action, try again."
fi
Expand All @@ -101,7 +101,7 @@ deploy_all() {
cd "$SRVINFRA_SERVICES_DIR" || exit 1
for DIR in */; do
echo "Deploying $DIR..."
docker compose -f "$DIR"/docker-compose.yml up -d --build --quiet-pull
docker compose -f "$DIR"/docker-compose.yml up -d --build --force-recreate --quiet-pull
done

# Deploy websites
Expand All @@ -110,7 +110,7 @@ deploy_all() {
cd "$TOP_DIR" || exit 1
for DIR in */; do
echo "Deploying $DIR..."
docker compose -f "$DIR"/docker-compose.yml -f "$DIR"/docker-compose-prod.yml up -d --build --quiet-pull
docker compose -f "$DIR"/docker-compose.yml -f "$DIR"/docker-compose-prod.yml up -d --build --force-recreate --quiet-pull
done
cd .. || exit 1
done
Expand All @@ -127,7 +127,7 @@ update() {
# 1. service name
echo "Updating $1..."
cd "$SRVINFRA_SERVICES_DIR"/"$1" || exit 1
docker compose pull && docker-compose up -d --build --quiet-pull || exit 1
docker compose pull && docker-compose up -d --build --force-recreate --quiet-pull || exit 1
echo "$1 updated!"
}

Expand All @@ -137,7 +137,7 @@ update_all() {
cd "$SRVINFRA_SERVICES_DIR" || exit 1
for DIR in */; do
printf '%s\n' "$DIR"
cd "$DIR" && docker compose pull && docker-compose up -d --build --quiet-pull
cd "$DIR" && docker compose pull && docker-compose up -d --build --force-recreate --quiet-pull
echo "$DIR updating..."
cd .. || exit 1
done
Expand Down

0 comments on commit 3acee08

Please sign in to comment.