blob: c9a1d435eec20a4e2d4715d657c03d843d912297 [file] [log] [blame]
Jonatan Antoni4b0ede32021-04-29 18:26:29 +02001#!/bin/bash
2
3# local variables
4DEPENDENCIES_FOLDER=dependenciesFiles
5ARTIFACTORY_URL=https://eu-west-1.artifactory.aws.arm.com:443/artifactory
6ARTIFACTORY_DEPOT=mcu.depot/ci/depot
7PACKCHK_VERSION=1.3.93
8
9if [ -z "$ARTIFACTORY_API_KEY" ]; then
10 echo "Please set your Artifactory ARTIFACTORY_API_KEY"
11 exit 1
12fi
13
14if [ -z "$USER" ]; then
15 echo "Please set your short ARM user e.g. sampel01"
16 exit 1
17fi
18
19function 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
36function downloadFromDepot {
37 downloadFromArtifactory "${ARTIFACTORY_DEPOT}/${1}"
38}
39
40function 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
53mkdir -p $DEPENDENCIES_FOLDER
54pushd $DEPENDENCIES_FOLDER || exit
55
56downloadFromDepot "doxygen_1.8.6-2_amd64.deb"
57downloadFromDepot "ArmCompiler-5.06u7-linux.sh"
58downloadFromDepot "ArmCompiler-6.16-linux-x86_64.sh"
59downloadFromDepot "ArmCompiler-6.6.4-linux-x86_64.sh"
60downloadFromDepot "gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2"
61downloadFromDepot "fvp-11.12-linux-x86_64.tar.gz"
62downloadFromArtifactory "mcu.promoted/staging/devtools/tools/packchk/${PACKCHK_VERSION}/linux64/PackChk"
63
64gitClone "ssh://${USER}@eu-gerrit-1.euhpc.arm.com:29418/dsg/cmsis/buildtools" "buildtools" "master"
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020065
66popd || exit