aecf18b842
Don't make Docker container copy artifact to a host directory mounted with -v, because this fails due to a file permission issue: build is run by a regular user, but the volume directory inside the container is owned by root. Instead, make the host copy the artifact from the container. Also, make the container print the artifact path before that. Just in case, in order to easily copy file manually, should something go wrong. ^KT-58864
24 lines
667 B
Bash
Executable File
24 lines
667 B
Bash
Executable File
#!/bin/bash
|
|
set -eou pipefail
|
|
|
|
CONTAINER_NAME=kotlin-toolchain-builder
|
|
IMAGE_NAME=kotlin-toolchain-builder
|
|
TARGET=$1
|
|
VERSION=$2
|
|
TOOLCHAIN_VERSION_SUFFIX="${3:-""}"
|
|
|
|
docker ps -a | grep $CONTAINER_NAME > /dev/null \
|
|
&& docker stop $CONTAINER_NAME > /dev/null \
|
|
&& docker rm $CONTAINER_NAME > /dev/null
|
|
|
|
echo "Running build script in container..."
|
|
docker run \
|
|
--env TARGET="$TARGET" \
|
|
--env VERSION="$VERSION" \
|
|
--env TOOLCHAIN_VERSION_SUFFIX="$TOOLCHAIN_VERSION_SUFFIX" \
|
|
--name=$CONTAINER_NAME $IMAGE_NAME
|
|
|
|
mkdir -p artifacts
|
|
docker cp kotlin-toolchain-builder:"/home/ct/x-tools/$TARGET-$VERSION-$TOOLCHAIN_VERSION_SUFFIX.tar.gz" artifacts/
|
|
|
|
echo "Done." |