Skip to content

Enhance Organization Mirroring with Improved Reliability and New Options #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions build-multiarch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
# Script to build and push multi-architecture Docker images for mirror-to-gitea

DOCKER_USERNAME="arunavo4"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs changing for this repo :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea missed it thanks, will update it with other stuff

REPO_NAME="mirror-to-gitea"
TAG="latest"
BUILDER_NAME="multiarch-builder"

# Check if builder exists, else create with docker-container driver
if ! docker buildx inspect "$BUILDER_NAME" >/dev/null 2>&1; then
echo "Creating buildx builder '$BUILDER_NAME' with docker-container driver..."
docker buildx create --name "$BUILDER_NAME" --driver docker-container --use
else
echo "Using existing buildx builder '$BUILDER_NAME'"
docker buildx use "$BUILDER_NAME"
fi

# Ensure builder is bootstrapped
docker buildx inspect --bootstrap

echo "Building and pushing multi-architecture images for $DOCKER_USERNAME/$REPO_NAME:$TAG"
docker buildx build --platform linux/amd64,linux/arm64 \
--tag $DOCKER_USERNAME/$REPO_NAME:$TAG \
--push \
.

if [ ! -z "$1" ]; then
VERSION_TAG="$1"
echo "Also tagging as $DOCKER_USERNAME/$REPO_NAME:$VERSION_TAG"
docker buildx build --platform linux/amd64,linux/arm64 \
--tag $DOCKER_USERNAME/$REPO_NAME:$VERSION_TAG \
--push \
.
fi

echo "Multi-architecture images built and pushed successfully!"
echo "Supported architectures:"
echo "- linux/amd64 (Intel/AMD 64-bit)"
echo "- linux/arm64 (ARM 64-bit, e.g., Apple Silicon, newer Raspberry Pi)"

echo ""
echo "Usage:"
echo "docker pull $DOCKER_USERNAME/$REPO_NAME:$TAG"
echo ""
echo "Docker will automatically select the correct image for your architecture."
2 changes: 1 addition & 1 deletion src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ async function mirror(repository, gitea, giteaTarget, githubToken, mirrorIssuesF
}
}
// For starred repositories, use the starred repos organization if configured
else if (repository.starred && gitea.starredReposOrg) {
if (repository.starred && gitea.starredReposOrg) {
// Get the starred repos organization
const starredOrg = await getGiteaOrganization(gitea, gitea.starredReposOrg);
if (starredOrg) {
Expand Down