File tree Expand file tree Collapse file tree 3 files changed +46
-13
lines changed
Expand file tree Collapse file tree 3 files changed +46
-13
lines changed Original file line number Diff line number Diff line change 1818 override :
1919 - ' chmod +x ./tools/ci/circle/script && ./tools/ci/circle/script ' :
2020 parallel : true
21+ post :
22+ - ' chmod +x ./tools/ci/circle/after_script && ./tools/ci/circle/after_script ' :
23+ parallel : true
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # Build script to run at the end of the Circle CI test [lifecycle][1].
4+ #
5+ # [1]: https://circleci.com/docs/configuration/#test
6+
7+
8+ # VARIABLES #
9+
10+ # Define a file containing log output:
11+ log_file=' /var/log/circle-ci.log'
12+
13+ # Define the number of lines of logged output to print:
14+ tail_num_lines=5000
15+
16+
17+ # FUNCTIONS #
18+
19+ # Defines an error handler.
20+ on_error () {
21+ echo ' ERROR: An error was encountered during execution.' >&2
22+ exit 1
23+ }
24+
25+ # Tails a log file.
26+ #
27+ # $1 - log file to tail
28+ # $2 - number of lines to tail
29+ tail_output () {
30+ echo " Printing the last $2 lines of log output..." >&2
31+ tail -" $2 " " $1 "
32+ }
33+
34+ # Main execution sequence.
35+ main () {
36+ tail_output " ${log_file} " " ${tail_num_lines} "
37+ }
38+
39+ # Set an error handler:
40+ trap ' on_error' ERR
41+
42+ # Run main:
43+ main
Original file line number Diff line number Diff line change @@ -59,9 +59,6 @@ heartbeat_interval='30s'
5959# Declare a variable for storing the heartbeat process id:
6060heartbeat_pid=" "
6161
62- # Define the number of lines of logged output to print upon completion:
63- tail_num_lines=4000
64-
6562
6663# FUNCTIONS #
6764
@@ -76,7 +73,6 @@ on_error() {
7673
7774# Runs clean-up tasks.
7875cleanup () {
79- tail_output " ${log_file} " " ${tail_num_lines} "
8076 stop_heartbeat
8177}
8278
@@ -110,15 +106,6 @@ stop_heartbeat() {
110106 kill " ${heartbeat_pid} "
111107}
112108
113- # Tails a log file.
114- #
115- # $1 - log file to tail
116- # $2 - number of lines to tail
117- tail_output () {
118- echo " Printing the last $2 lines of log output..." >&2
119- tail -" $2 " " $1 "
120- }
121-
122109# Creates a directory.
123110#
124111# $1 - directory path
You can’t perform that action at this time.
0 commit comments