refresh
This commit is contained in:
@@ -4,12 +4,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
HARBOR_REGISTRY="harbor.scottyah.com/bestofpb"
|
||||
|
||||
get_latest_version() {
|
||||
# Get the latest version tag from podman images for pb-backend or pb-frontend
|
||||
podman images --format '{{.Repository}}:{{.Tag}}' | \
|
||||
grep -E '(pb-(backend|frontend)|harbor\.scottyah\.com/bestofpb/pb-(backend|frontend)):v[0-9]+\.[0-9]+\.[0-9]+' | \
|
||||
grep -E 'pb-(backend|frontend):v[0-9]+\.[0-9]+\.[0-9]+' | \
|
||||
sed -E 's/.*:(v[0-9]+\.[0-9]+\.[0-9]+)$/\1/' | \
|
||||
sort -V | tail -n 1
|
||||
}
|
||||
@@ -40,21 +38,15 @@ fi
|
||||
|
||||
# Build backend image
|
||||
echo "Building backend image..."
|
||||
podman build -t ${HARBOR_REGISTRY}/pb-backend:$VERSION ./backend
|
||||
podman tag ${HARBOR_REGISTRY}/pb-backend:$VERSION ${HARBOR_REGISTRY}/pb-backend:latest
|
||||
podman build --platform=linux/arm64 -t pb-backend:$VERSION ./backend
|
||||
|
||||
echo "Building frontend image..."
|
||||
podman build -t ${HARBOR_REGISTRY}/pb-frontend:$VERSION ./frontend
|
||||
podman tag ${HARBOR_REGISTRY}/pb-frontend:$VERSION ${HARBOR_REGISTRY}/pb-frontend:latest
|
||||
podman build --platform=linux/arm64 -t pb-frontend:$VERSION ./frontend
|
||||
|
||||
echo "\nBuild complete. Images:"
|
||||
echo " ${HARBOR_REGISTRY}/pb-backend:$VERSION"
|
||||
echo " ${HARBOR_REGISTRY}/pb-frontend:$VERSION"
|
||||
echo " pb-backend:$VERSION"
|
||||
echo " pb-frontend:$VERSION"
|
||||
|
||||
echo "\nPushing images to Harbor..."
|
||||
podman push ${HARBOR_REGISTRY}/pb-backend:$VERSION
|
||||
podman push ${HARBOR_REGISTRY}/pb-backend:latest
|
||||
podman push ${HARBOR_REGISTRY}/pb-frontend:$VERSION
|
||||
podman push ${HARBOR_REGISTRY}/pb-frontend:latest
|
||||
|
||||
echo "\nImages pushed successfully to Harbor registry"
|
||||
echo "\nSaving images to tar files:"
|
||||
podman image save -o frontend.tar pb-frontend:$VERSION
|
||||
podman image save -o backend.tar pb-backend:$VERSION
|
||||
Reference in New Issue
Block a user