-
Notifications
You must be signed in to change notification settings - Fork 0
/
runBuildPrep.sh
executable file
·53 lines (43 loc) · 1.37 KB
/
runBuildPrep.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#
# Copyright 2021 Hewlett Packard Enterprise Development LP. All rights reserved.
#
PACKAGES="wget"
if command -v yum > /dev/null; then
yum install -y $PACKAGES
elif command -v zypper > /dev/null; then
zypper -n install $PACKAGES
else
"Unsupported package manager or package manager not found -- installing nothing"
fi
for each in firmware/* ; do
if [[ -d $each ]] ; then
pushd $each
for entry in $(cat manifest) ; do
wget https://arti.hpc.amslabs.hpecorp.net/artifactory/mellanox-third-party-stable-local/$entry
done
popd
fi
done
rm $(find . -name '*.bin.*')
if [[ -v SHS_NEW_BUILD_SYSTEM ]]; then
. ${CE_INCLUDE_PATH}/load.sh
replace_release_metadata "slingshot-firmware-management.spec"
else
set -x
BRANCH=`git branch --show-current || git rev-parse --abbrev-ref HEAD`
if [ -d hpc-shs-version ]; then
git -C hpc-shs-version pull
else
if [[ -n "${SHS_LOCAL_BUILD}" ]]; then
git clone [email protected]:hpe/hpc-shs-version.git
else
git clone https://[email protected]/hpe/hpc-shs-version.git
fi
fi
. hpc-shs-version/scripts/get-shs-version.sh
. hpc-shs-version/scripts/get-shs-label.sh
PRODUCT_VERSION=$(get_shs_version)
PRODUCT_LABEL=$(get_shs_label)
sed -i "s/Release:.*/Release: ${PRODUCT_LABEL}${PRODUCT_VERSION}_%(echo \\\${BUILD_METADATA:-1})/g" slingshot-firmware-management.spec
fi