jjb: fix modules arm64 crossbuild
[lttng-ci.git] / scripts / lttng-baremetal-tests / generate-properties-master.sh
CommitLineData
b3d73c46
FD
1#!/bin/bash -xeu
2# Copyright (C) 2016 - Francis Deslauriers <francis.deslauriers@efficios.com>
3#
4# This program is free software: you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation, either version 3 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17touch properties.txt
18if [ -n "${UST_BRANCH+x}" ]; then
19 LTTNG_UST_PATH="$WORKSPACE/src/lttng-ust"
20 git clone https://github.com/lttng/lttng-ust "$LTTNG_UST_PATH"
21
22 pushd "$LTTNG_UST_PATH"
23 git checkout "$UST_BRANCH"
24 popd
25
9fb14641 26 LTTNG_UST_COMMIT_ID="$(git --git-dir="$LTTNG_UST_PATH"/.git/ --work-tree="$LTTNG_UST_PATH" rev-parse --short HEAD)"
b3d73c46
FD
27 echo "LTTNG_UST_PATH=$LTTNG_UST_PATH" >> properties.txt
28 echo "LTTNG_UST_COMMIT_ID=$LTTNG_UST_COMMIT_ID" >> properties.txt
29fi
30
31LTTNG_CI_PATH="$WORKSPACE/src/lttng-ci"
32LINUX_PATH="$WORKSPACE/src/linux"
33LTTNG_MODULES_PATH="$WORKSPACE/src/lttng-modules"
34LTTNG_TOOLS_PATH="$WORKSPACE/src/lttng-tools"
35
36echo "LTTNG_CI_PATH=$LTTNG_CI_PATH" >> properties.txt
37echo "LINUX_PATH=$LINUX_PATH" >> properties.txt
38echo "LTTNG_MODULES_PATH=$LTTNG_MODULES_PATH" >> properties.txt
39echo "LTTNG_TOOLS_PATH=$LTTNG_TOOLS_PATH" >> properties.txt
40
82f57fe2
FD
41# Checkout the last kernel tag for cases where the job is triggered by commits
42# on the LTTng repos
43KERNEL_TAG="$(git --git-dir="$LINUX_PATH"/.git/ --work-tree="$LINUX_PATH" describe --abbrev=0)"
44git --git-dir="$LINUX_PATH"/.git/ --work-tree="$LINUX_PATH" checkout "$KERNEL_TAG"
45
a60dbc7c 46KERNEL_COMMIT_ID="$(git --git-dir="$LINUX_PATH"/.git/ --work-tree="$LINUX_PATH" rev-parse HEAD)"
9fb14641
FD
47LTTNG_MODULES_COMMIT_ID="$(git --git-dir="$LTTNG_MODULES_PATH"/.git/ --work-tree="$LTTNG_MODULES_PATH" rev-parse --short HEAD)"
48LTTNG_TOOLS_COMMIT_ID="$(git --git-dir="$LTTNG_TOOLS_PATH"/.git/ --work-tree="$LTTNG_TOOLS_PATH" rev-parse --short HEAD)"
49
50KERNEL_VERSION="$(make -s --directory=$LINUX_PATH kernelversion | sed 's/\./_/g; s/-/_/g';)"
b3d73c46
FD
51
52echo "KERNEL_COMMIT_ID=$KERNEL_COMMIT_ID" >> properties.txt
53echo "LTTNG_MODULES_COMMIT_ID=$LTTNG_MODULES_COMMIT_ID" >> properties.txt
54echo "LTTNG_TOOLS_COMMIT_ID=$LTTNG_TOOLS_COMMIT_ID" >> properties.txt
55
56BASE_STORAGE_FOLDER="/storage/jenkins-lava/baremetal-tests"
57
b32d6f9c 58echo "BASE_STORAGE_FOLDER=$BASE_STORAGE_FOLDER" >> properties.txt
55758044 59echo "STORAGE_HOST=storage.internal.efficios.com" >> properties.txt
b32d6f9c
FD
60echo "STORAGE_USER=jenkins-lava" >> properties.txt
61
dc9700c9 62echo "BUILD_DEVICE=$BUILD_DEVICE" >> properties.txt
1edbbf45
FD
63KGITREPO=$(git --git-dir="$LINUX_PATH"/.git/ remote get-url origin)
64echo "KGITREPO=$KGITREPO" >> properties.txt
b3d73c46 65echo "STORAGE_KERNEL_FOLDER=$BASE_STORAGE_FOLDER/kernel" >> properties.txt
9fb14641
FD
66echo "STORAGE_KERNEL_IMAGE=$BASE_STORAGE_FOLDER/kernel/$KERNEL_VERSION-$KERNEL_COMMIT_ID.$BUILD_DEVICE.bzImage" >> properties.txt
67echo "STORAGE_LINUX_MODULES=$BASE_STORAGE_FOLDER/modules/linux/$KERNEL_VERSION-$KERNEL_COMMIT_ID.$BUILD_DEVICE.linux.modules.tar.gz" >> properties.txt
68echo "STORAGE_LTTNG_MODULES=$BASE_STORAGE_FOLDER/modules/lttng/$KERNEL_VERSION-$KERNEL_COMMIT_ID-$LTTNG_MODULES_COMMIT_ID.$BUILD_DEVICE.lttng.modules.tar.gz" >> properties.txt
b32d6f9c 69
This page took 0.025269 seconds and 4 git commands to generate.