diff --git a/schutzbot/Jenkinsfile b/schutzbot/Jenkinsfile index 20b9acdb..b12333f7 100644 --- a/schutzbot/Jenkinsfile +++ b/schutzbot/Jenkinsfile @@ -23,6 +23,7 @@ pipeline { AWS_CREDS = credentials('aws-credentials-osbuildci') } steps { + sh "schutzbot/ci_details.sh" sh "schutzbot/mockbuild.sh" stash ( includes: 'osbuild-mock.repo', @@ -36,6 +37,7 @@ pipeline { AWS_CREDS = credentials('aws-credentials-osbuildci') } steps { + sh "schutzbot/ci_details.sh" sh "schutzbot/mockbuild.sh" stash ( includes: 'osbuild-mock.repo', @@ -49,6 +51,7 @@ pipeline { AWS_CREDS = credentials('aws-credentials-osbuildci') } steps { + sh "schutzbot/ci_details.sh" sh "schutzbot/mockbuild.sh" stash ( includes: 'osbuild-mock.repo', @@ -126,6 +129,9 @@ pipeline { // need to copy/paste the same lines over and over above. void run_tests() { + // Get CI machine details. + sh "schutzbot/ci_details.sh" + // Run the tests from the repository. sh "schutzbot/run_tests.sh" diff --git a/schutzbot/ci_details.sh b/schutzbot/ci_details.sh new file mode 100755 index 00000000..28f5b329 --- /dev/null +++ b/schutzbot/ci_details.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Dumps details about the instance running the CI job. + +PRIMARY_IP=$(ip route get 8.8.8.8 | head -n 1 | cut -d' ' -f7) +EXTERNAL_IP=$(curl --retry 5 -s -4 icanhazip.com) +PTR=$(curl --retry 5 -s -4 icanhazptr.com) +CPUS=$(nproc) +MEM=$(free -m | grep -oP '\d+' | head -n 1) +DISK=$(df --output=size -h / | sed '1d;s/[^0-9]//g') +HOSTNAME=$(uname -n) + +echo -e "\033[0;36m" +cat << EOF +------------------------------------------------------------------------------ +CI MACHINE SPECS +------------------------------------------------------------------------------ + + Hostname: ${HOSTNAME} + Primary IP: ${PRIMARY_IP} + External IP: ${EXTERNAL_IP} + Reverse DNS: ${PTR} + CPUs: ${CPUS} + RAM: ${MEM} GB + DISK: ${DISK} GB + +------------------------------------------------------------------------------ +EOF +echo -e "\033[0m" \ No newline at end of file