@echo off
REM Script to push base images to Harbor for offline/isolated cluster builds

set HARBOR_REGISTRY=harbor.dvirlabs.com
set HARBOR_PROJECT=dockerhub

echo.
echo 🐳 Pushing base images to Harbor...
echo Registry: %HARBOR_REGISTRY%
echo Project: %HARBOR_PROJECT%
echo.

REM Login to Harbor
echo Please login to Harbor:
docker login %HARBOR_REGISTRY%

echo.
echo 📦 Processing base images...
echo.

REM Python base image
echo ➡️  Processing: python:3.11-slim
docker pull python:3.11-slim
docker tag python:3.11-slim %HARBOR_REGISTRY%/%HARBOR_PROJECT%/python:3.11-slim
docker push %HARBOR_REGISTRY%/%HARBOR_PROJECT%/python:3.11-slim
echo    ✅ Done
echo.

REM Node base image
echo ➡️  Processing: node:18-alpine
docker pull node:18-alpine
docker tag node:18-alpine %HARBOR_REGISTRY%/%HARBOR_PROJECT%/node:18-alpine
docker push %HARBOR_REGISTRY%/%HARBOR_PROJECT%/node:18-alpine
echo    ✅ Done
echo.

REM Nginx base image
echo ➡️  Processing: nginx:alpine
docker pull nginx:alpine
docker tag nginx:alpine %HARBOR_REGISTRY%/%HARBOR_PROJECT%/nginx:alpine
docker push %HARBOR_REGISTRY%/%HARBOR_PROJECT%/nginx:alpine
echo    ✅ Done
echo.

REM Postgres base image
echo ➡️  Processing: postgres:16-alpine
docker pull postgres:16-alpine
docker tag postgres:16-alpine %HARBOR_REGISTRY%/%HARBOR_PROJECT%/postgres:16-alpine
docker push %HARBOR_REGISTRY%/%HARBOR_PROJECT%/postgres:16-alpine
echo    ✅ Done
echo.

REM Alpine base image
echo ➡️  Processing: alpine:3.19
docker pull alpine:3.19
docker tag alpine:3.19 %HARBOR_REGISTRY%/%HARBOR_PROJECT%/alpine:3.19
docker push %HARBOR_REGISTRY%/%HARBOR_PROJECT%/alpine:3.19
echo    ✅ Done
echo.

REM Busybox images
echo ➡️  Processing: busybox:1.35
docker pull busybox:1.35
docker tag busybox:1.35 %HARBOR_REGISTRY%/%HARBOR_PROJECT%/busybox:1.35
docker push %HARBOR_REGISTRY%/%HARBOR_PROJECT%/busybox:1.35
echo    ✅ Done
echo.

echo ➡️  Processing: busybox:latest
docker pull busybox:latest
docker tag busybox:latest %HARBOR_REGISTRY%/%HARBOR_PROJECT%/busybox:latest
docker push %HARBOR_REGISTRY%/%HARBOR_PROJECT%/busybox:latest
echo    ✅ Done
echo.

echo.
echo 🎉 All base images pushed successfully!
echo.
echo Your Harbor now contains all required base images.
echo You can now build your application in the cluster without Docker Hub access!
echo.
pause
