• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3set -e
4set -o xtrace
5
6CROSS_FILE=/cross_file-"$CROSS".txt
7
8# Delete unused bin and includes from artifacts to save space.
9rm -rf install/bin install/include
10
11# Strip the drivers in the artifacts to cut 80% of the artifacts size.
12if [ -n "$CROSS" ]; then
13    STRIP=`sed -n -E "s/strip\s*=\s*'(.*)'/\1/p" "$CROSS_FILE"`
14    if [ -z "$STRIP" ]; then
15        echo "Failed to find strip command in cross file"
16        exit 1
17    fi
18else
19    STRIP="strip"
20fi
21if [ -z "$ARTIFACTS_DEBUG_SYMBOLS" ]; then
22    find install -name \*.so -exec $STRIP {} \;
23fi
24
25# Test runs don't pull down the git tree, so put the dEQP helper
26# script and associated bits there.
27echo "$(cat VERSION) (git-$(git rev-parse HEAD | cut -b -10))" > install/VERSION
28cp -Rp .gitlab-ci/bare-metal install/
29cp -Rp .gitlab-ci/common install/
30cp -Rp .gitlab-ci/piglit install/
31cp -Rp .gitlab-ci/fossils.yml install/
32cp -Rp .gitlab-ci/fossils install/
33cp -Rp .gitlab-ci/fossilize-runner.sh install/
34cp -Rp .gitlab-ci/crosvm-init.sh install/
35cp -Rp .gitlab-ci/*.txt install/
36cp -Rp .gitlab-ci/report-flakes.py install/
37cp -Rp .gitlab-ci/vkd3d-proton install/
38cp -Rp .gitlab-ci/*-runner.sh install/
39find . -path \*/ci/\*.txt \
40    -o -path \*/ci/\*.toml \
41    -o -path \*/ci/\*traces\*.yml \
42    | xargs -I '{}' cp -p '{}' install/
43
44# Tar up the install dir so that symlinks and hardlinks aren't each
45# packed separately in the zip file.
46mkdir -p artifacts/
47tar -cf artifacts/install.tar install
48cp -Rp .gitlab-ci/common artifacts/ci-common
49cp -Rp .gitlab-ci/lava artifacts/
50
51if [ -n "$MINIO_ARTIFACT_NAME" ]; then
52    # Pass needed files to the test stage
53    MINIO_ARTIFACT_NAME="$MINIO_ARTIFACT_NAME.tar.gz"
54    gzip -c artifacts/install.tar > ${MINIO_ARTIFACT_NAME}
55    ci-fairy minio login $CI_JOB_JWT
56    ci-fairy minio cp ${MINIO_ARTIFACT_NAME} minio://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}
57fi
58