feat: add canary builds for testing purposes

This commit is contained in:
Mauricio Siu
2024-05-01 19:44:41 -06:00
parent 04a2ca49f3
commit 63b5fdaa71
6 changed files with 126 additions and 9 deletions

View File

@@ -1,7 +1,18 @@
#!/bin/bash
VERSION=$(node -p "require('./package.json').version")
# Determine the type of build based on the first script argument
BUILD_TYPE=${1:-production}
docker build --platform linux/amd64 --pull --rm -f 'Dockerfile' -t "dokploy/dokploy:${VERSION}" .
if [ "$BUILD_TYPE" == "canary" ]; then
TAG="canary"
else
VERSION=$(node -p "require('./package.json').version")
TAG="$VERSION"
fi
docker tag "dokploy/dokploy:${VERSION}" "dokploy/dokploy:latest"
docker build --platform linux/amd64 --pull --rm -f 'Dockerfile' -t "dokploy/dokploy:${TAG}" .
if [ "$BUILD_TYPE" != "canary" ]; then
# Tag the production build as latest
docker tag "dokploy/dokploy:${TAG}" "dokploy/dokploy:latest"
fi