Browse Source

Maintenance: Add debug output about CI environment on job finish.

Martin Gruner 2 years ago
parent
commit
bf8dc8b5e9
3 changed files with 26 additions and 0 deletions
  1. 3 0
      .gitlab-ci.yml
  2. 4 0
      .gitlab/ci/pre.yml
  3. 19 0
      .gitlab/environment_info.sh

+ 3 - 0
.gitlab-ci.yml

@@ -63,3 +63,6 @@ before_script:
   - echo -e "\\e[0Ksection_end:`date +%s`:bundle_install\\r\\e[0K"
   - bundle exec ruby .gitlab/configure_environment.rb
   - source .gitlab/environment.env
+
+after_script:
+  - .gitlab/environment_info.sh > log/environment_info.log

+ 4 - 0
.gitlab/ci/pre.yml

@@ -4,6 +4,7 @@
   extends:
     - .tags_docker
     - .rules_singletest
+    - .artifacts_error
   before_script:
     - source /etc/profile.d/rvm.sh # ensure RVM is loaded
     - source /opt/rh/rh-nodejs*/enable # ensure Node.js is available
@@ -14,6 +15,7 @@
     - .tags_docker
     - .rules_singletest
     - .services_postgresql
+    - .artifacts_error
   before_script:
     - source /etc/profile.d/rvm.sh # ensure RVM is loaded
     - source /opt/rh/rh-nodejs*/enable # ensure Node.js is available
@@ -36,6 +38,8 @@
     - echo "Disable default before_script."
   script:
     - shellcheck -S warning $(find . -name "*.sh" -o -name "functions" | grep -v "/vendor/")
+  after_script:
+    - echo "Disable default before_script."
 
 "lint: i18n, rails & security":
   <<: *template_pre_rails

+ 19 - 0
.gitlab/environment_info.sh

@@ -0,0 +1,19 @@
+#!/bin/bash
+
+date -u --rfc-3339=seconds
+echo
+top -b -n1 -w240
+echo
+ps aux --width 240
+echo
+free -m
+echo
+mount
+echo
+df -h
+echo
+echo "Last 100 lines from kernel log"
+dmesg | tail -n 100
+echo
+echo "Last 1000 lines from system log (journalctl)"
+journalctl | tail -n 1000