Add CI details script
Dump the machine specs for the system running the CI job very early during the job run. Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
parent
d74fc4e3fa
commit
4364b0a181
2 changed files with 34 additions and 0 deletions
6
schutzbot/Jenkinsfile
vendored
6
schutzbot/Jenkinsfile
vendored
|
|
@ -29,6 +29,7 @@ pipeline {
|
|||
AWS_CREDS = credentials('aws-credentials-osbuildci')
|
||||
}
|
||||
steps {
|
||||
sh "schutzbot/ci_details.sh"
|
||||
sh "schutzbot/mockbuild.sh"
|
||||
stash (
|
||||
includes: 'osbuild-mock.repo',
|
||||
|
|
@ -42,6 +43,7 @@ pipeline {
|
|||
AWS_CREDS = credentials('aws-credentials-osbuildci')
|
||||
}
|
||||
steps {
|
||||
sh "schutzbot/ci_details.sh"
|
||||
sh "schutzbot/mockbuild.sh"
|
||||
stash (
|
||||
includes: 'osbuild-mock.repo',
|
||||
|
|
@ -55,6 +57,7 @@ pipeline {
|
|||
AWS_CREDS = credentials('aws-credentials-osbuildci')
|
||||
}
|
||||
steps {
|
||||
sh "schutzbot/ci_details.sh"
|
||||
sh "schutzbot/mockbuild.sh"
|
||||
stash (
|
||||
includes: 'osbuild-mock.repo',
|
||||
|
|
@ -180,6 +183,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"
|
||||
|
||||
|
|
|
|||
28
schutzbot/ci_details.sh
Executable file
28
schutzbot/ci_details.sh
Executable file
|
|
@ -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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue