From b33f21f4806f3fbabd3f8d3837d627d5edb16bac Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Wed, 10 Jan 2018 17:13:28 -0500 Subject: [PATCH] jjb: lava: use Jenkins' Git plugin to checkout projects rather than doing manual git clones Signed-off-by: Francis Deslauriers --- jobs/system-tests.yaml | 34 +++++++++++++++++++ scripts/system-tests/check-build-needs.sh | 12 +------ .../generate-properties-master.sh | 10 ++---- .../system-tests/generate-properties-slave.sh | 2 -- .../system-tests/run-baremetal-benchmarks.sh | 3 -- scripts/system-tests/run-baremetal-tests.sh | 2 -- scripts/system-tests/run-kvm-fuzzing-tests.sh | 2 -- scripts/system-tests/run-kvm-tests.sh | 2 -- 8 files changed, 38 insertions(+), 29 deletions(-) diff --git a/jobs/system-tests.yaml b/jobs/system-tests.yaml index 1dedd47..b7a0fcc 100644 --- a/jobs/system-tests.yaml +++ b/jobs/system-tests.yaml @@ -95,6 +95,10 @@ - inject: properties-content: | BUILD_DEVICE=baremetal + scm: + - git: + url: https://github.com/lttng/lttng-ci + basedir: src/lttng-ci/ builders: - shell: !include-raw-escape: scripts/system-tests/generate-properties-master.sh @@ -148,6 +152,11 @@ properties-content: | BUILD_DEVICE=kvm + scm: + - git: + url: https://github.com/lttng/lttng-ci + basedir: src/lttng-ci/ + builders: - shell: !include-raw-escape: scripts/system-tests/generate-properties-master.sh - trigger-builds: @@ -190,6 +199,11 @@ properties-content: | BUILD_DEVICE=kvm + scm: + - git: + url: https://github.com/lttng/lttng-ci + basedir: src/lttng-ci/ + builders: - shell: !include-raw-escape: scripts/system-tests/generate-properties-master.sh - trigger-builds: @@ -233,6 +247,11 @@ properties-content: | BUILD_DEVICE=baremetal + scm: + - git: + url: https://github.com/lttng/lttng-ci + basedir: src/lttng-ci/ + builders: - shell: !include-raw-escape: scripts/system-tests/generate-properties-master.sh - trigger-builds: @@ -297,6 +316,21 @@ credential-id: system_tests_storage_key variable: identity_file + scm: + - git: + url: https://github.com/lttng/lttng-ci + basedir: src/lttng-ci/ + - git: + url : $KGITREPO + basedir: src/linux/ + branches: + - $KERNEL_COMMIT_ID + - git: + url : $LTTNG_MODULES_REPO + basedir: src/lttng-modules/ + branches: + - $LTTNG_MODULES_COMMIT_ID + builders: - shell: !include-raw-escape: scripts/system-tests/generate-properties-slave.sh - inject: diff --git a/scripts/system-tests/check-build-needs.sh b/scripts/system-tests/check-build-needs.sh index 625047e..162a7c4 100644 --- a/scripts/system-tests/check-build-needs.sh +++ b/scripts/system-tests/check-build-needs.sh @@ -37,17 +37,7 @@ set -e # kernel or modules if [ $NEED_MODULES_BUILD -eq 1 ] || [ $NEED_KERNEL_BUILD -eq 1 ] ; then - git clone "$KGITREPO" "$LINUX_PATH" - pushd "$LINUX_PATH" - git checkout "$KERNEL_COMMIT_ID" - popd - git clone "$LTTNG_MODULES_GIT" "$LTTNG_MODULES_PATH" - pushd "$LTTNG_MODULES_PATH" - git checkout "$LTTNG_MODULES_COMMIT_ID" - popd - - git clone https://github.com/lttng/lttng-ci "$LTTNG_CI_PATH" - cp "$LTTNG_CI_PATH"/lava/kernel/vanilla/x86_64_server.config "$LINUX_PATH/.config" + cp src/lttng-ci/lava/kernel/vanilla/x86_64_server.config "$LINUX_PATH/.config" make --directory="$LINUX_PATH" olddefconfig if [ $BUILD_DEVICE = 'kvm' ] ; then diff --git a/scripts/system-tests/generate-properties-master.sh b/scripts/system-tests/generate-properties-master.sh index 733b6ed..bb2e25b 100644 --- a/scripts/system-tests/generate-properties-master.sh +++ b/scripts/system-tests/generate-properties-master.sh @@ -16,13 +16,9 @@ touch properties.txt -KERNEL_COMMIT_ID=$kernel_tag_id -LTTNG_MODULES_COMMIT_ID=$modules_commit_id -LTTNG_TOOLS_COMMIT_ID=$tools_commit_id -LTTNG_UST_COMMIT_ID=$ust_commit_id - LTTNG_CI_PATH="$WORKSPACE/src/lttng-ci" echo "LTTNG_CI_PATH=$LTTNG_CI_PATH" >> properties.txt +KERNEL_COMMIT_ID=$KERNEL_TAG_ID echo "KERNEL_COMMIT_ID=$KERNEL_COMMIT_ID" >> properties.txt echo "LTTNG_MODULES_COMMIT_ID=$LTTNG_MODULES_COMMIT_ID" >> properties.txt @@ -36,8 +32,8 @@ echo "STORAGE_HOST=storage.internal.efficios.com" >> properties.txt echo "STORAGE_USER=jenkins-lava" >> properties.txt echo "BUILD_DEVICE=$BUILD_DEVICE" >> properties.txt -echo "KGITREPO=$kernel_repo" >> properties.txt +echo "KGITREPO=$KERNEL_REPO" >> properties.txt echo "STORAGE_KERNEL_FOLDER=$BASE_STORAGE_FOLDER/kernel" >> properties.txt echo "STORAGE_KERNEL_IMAGE=$BASE_STORAGE_FOLDER/kernel/$KERNEL_COMMIT_ID.$BUILD_DEVICE.bzImage" >> properties.txt echo "STORAGE_LINUX_MODULES=$BASE_STORAGE_FOLDER/modules/linux/$KERNEL_COMMIT_ID.$BUILD_DEVICE.linux.modules.tar.gz" >> properties.txt -echo "STORAGE_LTTNG_MODULES=$BASE_STORAGE_FOLDER/modules/lttng/i$KERNEL_COMMIT_ID-$LTTNG_MODULES_COMMIT_ID.$BUILD_DEVICE.lttng.modules.tar.gz" >> properties.txt +echo "STORAGE_LTTNG_MODULES=$BASE_STORAGE_FOLDER/modules/lttng/$KERNEL_COMMIT_ID-$LTTNG_MODULES_COMMIT_ID.$BUILD_DEVICE.lttng.modules.tar.gz" >> properties.txt diff --git a/scripts/system-tests/generate-properties-slave.sh b/scripts/system-tests/generate-properties-slave.sh index d82119c..426e3b5 100644 --- a/scripts/system-tests/generate-properties-slave.sh +++ b/scripts/system-tests/generate-properties-slave.sh @@ -20,12 +20,10 @@ touch properties.txt NPROC=$(nproc) echo "NPROC=$NPROC" >> properties.txt -LTTNG_CI_PATH="$WORKSPACE/src/lttng-ci" LINUX_PATH="$WORKSPACE/src/linux" LTTNG_MODULES_PATH="$WORKSPACE/src/lttng-modules" echo "LTTNG_MODULES_GIT=$LTTNG_MODULES_REPO" >> properties.txt -echo "LTTNG_CI_PATH=$LTTNG_CI_PATH" >> properties.txt echo "LINUX_PATH=$LINUX_PATH" >> properties.txt echo "LTTNG_MODULES_PATH=$LTTNG_MODULES_PATH" >> properties.txt diff --git a/scripts/system-tests/run-baremetal-benchmarks.sh b/scripts/system-tests/run-baremetal-benchmarks.sh index aa6be86..227d3f5 100644 --- a/scripts/system-tests/run-baremetal-benchmarks.sh +++ b/scripts/system-tests/run-baremetal-benchmarks.sh @@ -16,9 +16,6 @@ echo 'At this point, we built the modules and kernel if we needed to.' echo 'We can now launch the lava job using those artefacts' - -git clone https://github.com/lttng/lttng-ci "$LTTNG_CI_PATH" - python3 -u "$LTTNG_CI_PATH"/scripts/lttng-baremetal-tests/lava-submit.py \ -t baremetal-benchmarks \ -j "$JOB_NAME" \ diff --git a/scripts/system-tests/run-baremetal-tests.sh b/scripts/system-tests/run-baremetal-tests.sh index 2f9eee8..62dcd51 100644 --- a/scripts/system-tests/run-baremetal-tests.sh +++ b/scripts/system-tests/run-baremetal-tests.sh @@ -16,8 +16,6 @@ echo 'At this point, we built the modules and kernel if we needed to.' echo 'We can now launch the lava job using those artefacts' -git clone https://github.com/lttng/lttng-ci "$LTTNG_CI_PATH" - python3 -u "$LTTNG_CI_PATH"/scripts/lttng-baremetal-tests/lava-submit.py \ -t baremetal-tests \ -j "$JOB_NAME" \ diff --git a/scripts/system-tests/run-kvm-fuzzing-tests.sh b/scripts/system-tests/run-kvm-fuzzing-tests.sh index a7ba525..b8dc899 100644 --- a/scripts/system-tests/run-kvm-fuzzing-tests.sh +++ b/scripts/system-tests/run-kvm-fuzzing-tests.sh @@ -16,8 +16,6 @@ echo 'At this point, we built the modules and kernel if we needed to.' echo 'We can now launch the lava job using those artefacts' -git clone https://github.com/lttng/lttng-ci "$LTTNG_CI_PATH" - python3 -u "$LTTNG_CI_PATH"/scripts/lttng-baremetal-tests/lava-submit.py \ -t kvm-fuzzing-tests \ -j "$JOB_NAME" \ diff --git a/scripts/system-tests/run-kvm-tests.sh b/scripts/system-tests/run-kvm-tests.sh index 05eb693..c1100fc 100644 --- a/scripts/system-tests/run-kvm-tests.sh +++ b/scripts/system-tests/run-kvm-tests.sh @@ -16,8 +16,6 @@ echo 'At this point, we built the modules and kernel if we needed to.' echo 'We can now launch the lava job using those artefacts' -git clone https://github.com/lttng/lttng-ci "$LTTNG_CI_PATH" - python3 -u "$LTTNG_CI_PATH"/scripts/lttng-baremetal-tests/lava-submit.py \ -t kvm-tests \ -j "$JOB_NAME" \ -- 2.34.1