Native: move copying of toolchain builder artifact from Docker to host
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
This commit is contained in:
committed by
Space Team
parent
a276ad48a0
commit
aecf18b842
@@ -43,7 +43,9 @@ build_archive() {
|
||||
mv "$TARGET" "$FULL_NAME"
|
||||
ARCHIVE_NAME="$FULL_NAME.tar.gz"
|
||||
tar -czvf "$ARCHIVE_NAME" "$FULL_NAME"
|
||||
cp "$ARCHIVE_NAME" /artifacts/"$ARCHIVE_NAME"
|
||||
echo "$PWD/$ARCHIVE_NAME"
|
||||
mkdir -p ~/artifacts
|
||||
cp "$ARCHIVE_NAME" ~/artifacts/"$ARCHIVE_NAME"
|
||||
}
|
||||
|
||||
echo "building toolchain for $TARGET"
|
||||
|
||||
@@ -12,9 +12,13 @@ docker ps -a | grep $CONTAINER_NAME > /dev/null \
|
||||
&& docker rm $CONTAINER_NAME > /dev/null
|
||||
|
||||
echo "Running build script in container..."
|
||||
docker run -v "$PWD"/artifacts:/artifacts \
|
||||
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."
|
||||
Reference in New Issue
Block a user