Jonatan Antoni | 4b0ede3 | 2021-04-29 18:26:29 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # local variables |
| 4 | DEPENDENCIES_FOLDER=dependenciesFiles |
| 5 | ARTIFACTORY_URL=https://eu-west-1.artifactory.aws.arm.com:443/artifactory |
| 6 | ARTIFACTORY_DEPOT=mcu.depot/ci/depot |
| 7 | PACKCHK_VERSION=1.3.93 |
| 8 | |
| 9 | if [ -z "$ARTIFACTORY_API_KEY" ]; then |
| 10 | echo "Please set your Artifactory ARTIFACTORY_API_KEY" |
| 11 | exit 1 |
| 12 | fi |
| 13 | |
| 14 | if [ -z "$USER" ]; then |
| 15 | echo "Please set your short ARM user e.g. sampel01" |
| 16 | exit 1 |
| 17 | fi |
| 18 | |
| 19 | function downloadFromArtifactory { |
| 20 | filename=$(basename $1) |
| 21 | echo "Fetching ${filename} ..." |
| 22 | if [[ -f "${filename}" ]]; then |
| 23 | sha256sum=$(curl -s -I -H "X-JFrog-Art-Api:$ARTIFACTORY_API_KEY" "${ARTIFACTORY_URL}/${1}" | grep "X-Checksum-Sha256" | cut -d" " -f2) |
| 24 | if echo "${sha256sum} *${filename}" | sha256sum -c --status; then |
| 25 | echo " ... already up to date" |
| 26 | else |
| 27 | rm ${filename} |
| 28 | fi |
| 29 | fi |
| 30 | if [[ ! -f "${filename}" ]]; then |
| 31 | curl -C - -H "X-JFrog-Art-Api:$ARTIFACTORY_API_KEY" -O "${ARTIFACTORY_URL}/${1}" |
| 32 | chmod +x ${filename} |
| 33 | fi |
| 34 | } |
| 35 | |
| 36 | function downloadFromDepot { |
| 37 | downloadFromArtifactory "${ARTIFACTORY_DEPOT}/${1}" |
| 38 | } |
| 39 | |
| 40 | function gitClone { |
| 41 | echo "Cloning/updating ${2} ..." |
| 42 | if [[ ! -d "${2}" ]]; then |
| 43 | git clone -b $3 $1 $2 |
| 44 | else |
| 45 | pushd $2 |
| 46 | git clean -fdx |
| 47 | git checkout -f $3 |
| 48 | git pull origin $3 |
| 49 | popd |
| 50 | fi |
| 51 | } |
| 52 | |
| 53 | mkdir -p $DEPENDENCIES_FOLDER |
| 54 | pushd $DEPENDENCIES_FOLDER || exit |
| 55 | |
| 56 | downloadFromDepot "doxygen_1.8.6-2_amd64.deb" |
| 57 | downloadFromDepot "ArmCompiler-5.06u7-linux.sh" |
| 58 | downloadFromDepot "ArmCompiler-6.16-linux-x86_64.sh" |
| 59 | downloadFromDepot "ArmCompiler-6.6.4-linux-x86_64.sh" |
| 60 | downloadFromDepot "gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2" |
| 61 | downloadFromDepot "fvp-11.12-linux-x86_64.tar.gz" |
| 62 | downloadFromArtifactory "mcu.promoted/staging/devtools/tools/packchk/${PACKCHK_VERSION}/linux64/PackChk" |
| 63 | |
| 64 | gitClone "ssh://${USER}@eu-gerrit-1.euhpc.arm.com:29418/dsg/cmsis/buildtools" "buildtools" "master" |
Jonatan Antoni | 4b0ede3 | 2021-04-29 18:26:29 +0200 | [diff] [blame] | 65 | |
| 66 | popd || exit |