cost_file=$1
-while IFS="," read -r job_name build_number date resource uptime cost stack_cost; do
+while IFS="," read -r job_name build_number date resource uptime cost stack_cost build_result; do
[[ $resource == "0" ]] && resource='unknown'
- printf "%s,%s,%s,%s,%d,%.2f,%.2f\n" "$job_name" "$build_number" "$date" \
- "$resource" "$uptime" "$cost" "$stack_cost"
+ printf "%s,%s,%s,%s,%d,%.2f,%.2f,%s\n" "$job_name" "$build_number" "$date" \
+ "$resource" "$uptime" "$cost" "$stack_cost" "$build_result"
done < "$cost_file"
date=$(TZ=GMT date +'%Y-%m-%d %H:%M:%S')
# Format the uptime, cost & stack_cost fields
-printf "%s,%s,%s,%s,%d,%.2f,%.2f\n" "$JOB_NAME" "$BUILD_NUMBER" "$date" \
- "$resource" "$uptime" "$cost" "$stack_cost" > "$WORKSPACE/archives/cost.csv"
+printf "%s,%s,%s,%s,%d,%.2f,%.2f,%s\n" "$JOB_NAME" "$BUILD_NUMBER" "$date" \
+ "$resource" "$uptime" "$cost" "$stack_cost" "$BUILD_RESULT" > "$WORKSPACE/archives/cost.csv"