Skip to content

Commit b79acb8

Browse files
committed
CI: Use "docker run" for file manipulation, to prevent permission errors
Because the ZIP file has been created and unzipped with docker, manipulating it directly with system commands fails with permission error: mv: cannot move '/tmp/elasticsearch-c108b093b5a7da9b042d25969fd7339b86adc19f' to '/tmp/elasticsearch/': Operation not permitted (cherry picked from commit dfe749d)
1 parent eb37478 commit b79acb8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.jenkins/run-tests

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ ELASTICSEARCH_BUILD_HASH=$(docker run --network elasticsearch --rm appropriate/c
4646

4747
# Download Elasticsearch source code at ELASTICSEARCH_BUILD_HASH and store it in a container
4848
echo -e ">>>>> Downloading Elasticsearch repository @ $ELASTICSEARCH_BUILD_HASH..."
49-
time docker run --rm appropriate/curl --retry 3 -sSL https://github.com/elastic/elasticsearch/archive/$ELASTICSEARCH_BUILD_HASH.zip > /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip
50-
echo -e ">>>>> Extracting and storing to [elasticsearch-source:/elasticsearch-source]..."
51-
time docker run --volume=/tmp:/tmp --workdir=/tmp --rm elastic/go-elasticsearch unzip -q -o elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip '*.properties' '*.json' '*.y*ml'
52-
rm -rf /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip
53-
rm -rf /tmp/elasticsearch/
54-
mv /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH* /tmp/elasticsearch/
49+
time docker run --rm appropriate/curl --retry 3 -sSL "https://github.com/elastic/elasticsearch/archive/$ELASTICSEARCH_BUILD_HASH.zip" > "/tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip"
50+
echo -e ">>>>> Extracting and storing to [elasticsearch-source] container..."
51+
time docker run --volume=/tmp:/tmp --workdir=/tmp --rm elastic/go-elasticsearch unzip -q -o "elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip" '*.properties' '*.json' '*.y*ml'
52+
docker run --volume=/tmp:/tmp --workdir=/tmp --rm elastic/go-elasticsearch /bin/sh -c "
53+
rm -rf /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH.zip
54+
rm -rf /tmp/elasticsearch/
55+
mv /tmp/elasticsearch-$ELASTICSEARCH_BUILD_HASH* /tmp/elasticsearch/
56+
"
5557
docker create --name elasticsearch-source --volume /elasticsearch-source --name elasticsearch-source alpine /bin/true
5658
docker cp /tmp/elasticsearch elasticsearch-source:/elasticsearch-source
5759

0 commit comments

Comments
 (0)