platform/ws-tests/fetch-tool-bundle.sh
Andrey Sobolev 2b03c56939
UBERF-9633: More proper fix (#8249)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
2025-03-17 16:37:13 +04:00

33 lines
1003 B
Bash
Executable File

#!/bin/bash
set -e
# Define the path to the docker-compose.override.yml
DOCKER_COMPOSE_PATH="./docker-compose.override.yml"
# Extract the version of hardcoreeng/transactor from the docker-compose file
VERSION=$(grep "image: hardcoreeng/transactor:" "$DOCKER_COMPOSE_PATH" | head -1 | sed -E 's/.*image: hardcoreeng\/transactor:([^[:space:]]+).*/\1/')
if [ -z "$VERSION" ]; then
echo "Error: Could not find transactor version in docker-compose file"
exit 1
fi
echo "Found transactor version: $VERSION"
echo "Fetching hardcoreeng/tool:$VERSION..."
# Pull the tool image with the same version
docker pull "hardcoreeng/tool:$VERSION"
# Create a temporary container from the image
CONTAINER_ID=$(docker container create "hardcoreeng/tool:$VERSION")
# Extract bundle.js from the container
echo "Extracting bundle.js..."
docker cp "$CONTAINER_ID:/usr/src/app/bundle.js" "bundle.js"
# Clean up the temporary container
docker rm "$CONTAINER_ID"
echo "Successfully extracted bundle.js to bundle.js"