Migrate from Harbor to Gitea Packages registry #270
@@ -12,7 +12,7 @@ variables:
|
|||||||
# Kaniko base command setup
|
# Kaniko base command setup
|
||||||
- &kaniko_setup |
|
- &kaniko_setup |
|
||||||
mkdir -p /kaniko/.docker
|
mkdir -p /kaniko/.docker
|
||||||
echo "{\"auths\":{\"reg.mosaicstack.dev\":{\"username\":\"$HARBOR_USER\",\"password\":\"$HARBOR_PASS\"}}}" > /kaniko/.docker/config.json
|
echo "{\"auths\":{\"git.mosaicstack.dev\":{\"username\":\"$GITEA_USER\",\"password\":\"$GITEA_TOKEN\"}}}" > /kaniko/.docker/config.json
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
install:
|
install:
|
||||||
@@ -86,7 +86,7 @@ steps:
|
|||||||
# ======================
|
# ======================
|
||||||
# Docker Build & Push (main/develop only)
|
# Docker Build & Push (main/develop only)
|
||||||
# ======================
|
# ======================
|
||||||
# Requires secrets: harbor_username, harbor_password
|
# Requires secrets: gitea_username, gitea_token
|
||||||
#
|
#
|
||||||
# Tagging Strategy:
|
# Tagging Strategy:
|
||||||
# - Always: commit SHA (e.g., 658ec077)
|
# - Always: commit SHA (e.g., 658ec077)
|
||||||
@@ -98,24 +98,24 @@ steps:
|
|||||||
docker-build-api:
|
docker-build-api:
|
||||||
image: gcr.io/kaniko-project/executor:debug
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
environment:
|
environment:
|
||||||
HARBOR_USER:
|
GITEA_USER:
|
||||||
from_secret: harbor_username
|
from_secret: gitea_username
|
||||||
HARBOR_PASS:
|
GITEA_TOKEN:
|
||||||
from_secret: harbor_password
|
from_secret: gitea_token
|
||||||
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
||||||
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
||||||
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
||||||
commands:
|
commands:
|
||||||
- *kaniko_setup
|
- *kaniko_setup
|
||||||
- |
|
- |
|
||||||
DESTINATIONS="--destination reg.mosaicstack.dev/mosaic/api:${CI_COMMIT_SHA:0:8}"
|
DESTINATIONS="--destination git.mosaicstack.dev/mosaic/api:${CI_COMMIT_SHA:0:8}"
|
||||||
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
||||||
DESTINATIONS="$DESTINATIONS --destination reg.mosaicstack.dev/mosaic/api:latest"
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/api:latest"
|
||||||
elif [ "$CI_COMMIT_BRANCH" = "develop" ]; then
|
elif [ "$CI_COMMIT_BRANCH" = "develop" ]; then
|
||||||
DESTINATIONS="$DESTINATIONS --destination reg.mosaicstack.dev/mosaic/api:dev"
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/api:dev"
|
||||||
fi
|
fi
|
||||||
if [ -n "$CI_COMMIT_TAG" ]; then
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||||
DESTINATIONS="$DESTINATIONS --destination reg.mosaicstack.dev/mosaic/api:$CI_COMMIT_TAG"
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/api:$CI_COMMIT_TAG"
|
||||||
fi
|
fi
|
||||||
/kaniko/executor --context . --dockerfile apps/api/Dockerfile $DESTINATIONS
|
/kaniko/executor --context . --dockerfile apps/api/Dockerfile $DESTINATIONS
|
||||||
when:
|
when:
|
||||||
@@ -128,24 +128,24 @@ steps:
|
|||||||
docker-build-web:
|
docker-build-web:
|
||||||
image: gcr.io/kaniko-project/executor:debug
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
environment:
|
environment:
|
||||||
HARBOR_USER:
|
GITEA_USER:
|
||||||
from_secret: harbor_username
|
from_secret: gitea_username
|
||||||
HARBOR_PASS:
|
GITEA_TOKEN:
|
||||||
from_secret: harbor_password
|
from_secret: gitea_token
|
||||||
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
||||||
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
||||||
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
||||||
commands:
|
commands:
|
||||||
- *kaniko_setup
|
- *kaniko_setup
|
||||||
- |
|
- |
|
||||||
DESTINATIONS="--destination reg.mosaicstack.dev/mosaic/web:${CI_COMMIT_SHA:0:8}"
|
DESTINATIONS="--destination git.mosaicstack.dev/mosaic/web:${CI_COMMIT_SHA:0:8}"
|
||||||
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
||||||
DESTINATIONS="$DESTINATIONS --destination reg.mosaicstack.dev/mosaic/web:latest"
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/web:latest"
|
||||||
elif [ "$CI_COMMIT_BRANCH" = "develop" ]; then
|
elif [ "$CI_COMMIT_BRANCH" = "develop" ]; then
|
||||||
DESTINATIONS="$DESTINATIONS --destination reg.mosaicstack.dev/mosaic/web:dev"
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/web:dev"
|
||||||
fi
|
fi
|
||||||
if [ -n "$CI_COMMIT_TAG" ]; then
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||||
DESTINATIONS="$DESTINATIONS --destination reg.mosaicstack.dev/mosaic/web:$CI_COMMIT_TAG"
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/web:$CI_COMMIT_TAG"
|
||||||
fi
|
fi
|
||||||
/kaniko/executor --context . --dockerfile apps/web/Dockerfile --build-arg NEXT_PUBLIC_API_URL=https://api.mosaicstack.dev $DESTINATIONS
|
/kaniko/executor --context . --dockerfile apps/web/Dockerfile --build-arg NEXT_PUBLIC_API_URL=https://api.mosaicstack.dev $DESTINATIONS
|
||||||
when:
|
when:
|
||||||
@@ -158,24 +158,24 @@ steps:
|
|||||||
docker-build-postgres:
|
docker-build-postgres:
|
||||||
image: gcr.io/kaniko-project/executor:debug
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
environment:
|
environment:
|
||||||
HARBOR_USER:
|
GITEA_USER:
|
||||||
from_secret: harbor_username
|
from_secret: gitea_username
|
||||||
HARBOR_PASS:
|
GITEA_TOKEN:
|
||||||
from_secret: harbor_password
|
from_secret: gitea_token
|
||||||
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
||||||
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
||||||
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
||||||
commands:
|
commands:
|
||||||
- *kaniko_setup
|
- *kaniko_setup
|
||||||
- |
|
- |
|
||||||
DESTINATIONS="--destination reg.mosaicstack.dev/mosaic/postgres:${CI_COMMIT_SHA:0:8}"
|
DESTINATIONS="--destination git.mosaicstack.dev/mosaic/postgres:${CI_COMMIT_SHA:0:8}"
|
||||||
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
||||||
DESTINATIONS="$DESTINATIONS --destination reg.mosaicstack.dev/mosaic/postgres:latest"
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/postgres:latest"
|
||||||
elif [ "$CI_COMMIT_BRANCH" = "develop" ]; then
|
elif [ "$CI_COMMIT_BRANCH" = "develop" ]; then
|
||||||
DESTINATIONS="$DESTINATIONS --destination reg.mosaicstack.dev/mosaic/postgres:dev"
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/postgres:dev"
|
||||||
fi
|
fi
|
||||||
if [ -n "$CI_COMMIT_TAG" ]; then
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||||
DESTINATIONS="$DESTINATIONS --destination reg.mosaicstack.dev/mosaic/postgres:$CI_COMMIT_TAG"
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/postgres:$CI_COMMIT_TAG"
|
||||||
fi
|
fi
|
||||||
/kaniko/executor --context docker/postgres --dockerfile docker/postgres/Dockerfile $DESTINATIONS
|
/kaniko/executor --context docker/postgres --dockerfile docker/postgres/Dockerfile $DESTINATIONS
|
||||||
when:
|
when:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Production Docker Compose - Uses pre-built images from Harbor
|
# Production Docker Compose - Uses pre-built images from Gitea Packages
|
||||||
#
|
#
|
||||||
# Prerequisites:
|
# Prerequisites:
|
||||||
# - Images built and pushed to reg.diversecanvas.com/mosaic/*
|
# - Images built and pushed to git.mosaicstack.dev/mosaic/*
|
||||||
# - .env file configured with production values
|
# - .env file configured with production values
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
@@ -16,7 +16,7 @@ services:
|
|||||||
# PostgreSQL Database
|
# PostgreSQL Database
|
||||||
# ======================
|
# ======================
|
||||||
postgres:
|
postgres:
|
||||||
image: reg.diversecanvas.com/mosaic/postgres:latest
|
image: git.mosaicstack.dev/mosaic/postgres:latest
|
||||||
container_name: mosaic-postgres
|
container_name: mosaic-postgres
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
@@ -70,7 +70,7 @@ services:
|
|||||||
# Mosaic API
|
# Mosaic API
|
||||||
# ======================
|
# ======================
|
||||||
api:
|
api:
|
||||||
image: reg.diversecanvas.com/mosaic/api:latest
|
image: git.mosaicstack.dev/mosaic/api:latest
|
||||||
container_name: mosaic-api
|
container_name: mosaic-api
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
@@ -121,7 +121,7 @@ services:
|
|||||||
# Mosaic Web
|
# Mosaic Web
|
||||||
# ======================
|
# ======================
|
||||||
web:
|
web:
|
||||||
image: reg.diversecanvas.com/mosaic/web:latest
|
image: git.mosaicstack.dev/mosaic/web:latest
|
||||||
container_name: mosaic-web
|
container_name: mosaic-web
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user