Skip to content
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

Cross platform testing CI - local #540

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ ketangupta34 <[email protected]>
onkardahale <[email protected]>
Akshit Garg <[email protected]>
burnerlee <[email protected]>
Praveen Kumar <[email protected]>
Praveen Kumar <[email protected]>
Harsh Rao <[email protected]>
47 changes: 30 additions & 17 deletions docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,37 @@ sub_cache() {
$DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.cache.yml build cli
}

# Build MetaCall Docker Compose with multi-platform specifier (link manually dockerignore files)
sub_platform() {
if [ -z "$METACALL_PLATFORM" ]; then
echo "Error: METACALL_PLATFORM variable not defined"
exit 1
fi

ln -sf tools/deps/.dockerignore .dockerignore
$DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build deps

ln -sf tools/dev/.dockerignore .dockerignore
$DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build dev

ln -sf tools/runtime/.dockerignore .dockerignore
$DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build runtime

ln -sf tools/cli/.dockerignore .dockerignore
$DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build cli
# Default platform if not defined
if [ -z "$METACALL_PLATFORM" ]; then
METACALL_PLATFORM="linux/amd64"
echo "METACALL_PLATFORM not defined. Defaulting to: $METACALL_PLATFORM"
else
echo "Building for platform: $METACALL_PLATFORM"
fi

# Set up Buildx if not already configured
docker buildx ls | grep multiarch_builder || docker buildx create --name multiarch_builder --use
docker buildx inspect multiarch_builder --bootstrap

# Build dependencies
ln -sf tools/deps/.dockerignore .dockerignore
docker buildx build --platform $METACALL_PLATFORM -f docker-compose.yml -t metacall/deps .

# Build development environment
ln -sf tools/dev/.dockerignore .dockerignore
docker buildx build --platform $METACALL_PLATFORM -f docker-compose.yml -t metacall/dev .

# Build runtime for all platforms
ln -sf tools/runtime/.dockerignore .dockerignore
docker buildx build --platform $METACALL_PLATFORM -f docker-compose.yml -t metacall/runtime .

# Build CLI for all platforms
ln -sf tools/cli/.dockerignore .dockerignore
docker buildx build --platform $METACALL_PLATFORM -f docker-compose.yml -t metacall/cli .

echo "Build process complete for platform: $METACALL_PLATFORM"

}

# Push MetaCall Docker Compose
Expand Down
Loading