summaryrefslogtreecommitdiffstats
path: root/integration/src
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-07-13 11:40:56 +0100
committerliamfallon <liam.fallon@est.tech>2022-07-13 12:59:13 +0100
commit555565323a6095abcbe1a761faac2d71a455dfe0 (patch)
tree527aab3c52dad31444bbefc408af67168455aa10 /integration/src
parent12fea027b14c36fe3b8e16f5a2aeedab8366285c (diff)
Update release and report scripts
Release scripts are updated to automatically change the releae data CSV file in policy-parent/integration/src/main/resources Report script is updated t add HTTP links to the various reports Issue-ID: POLICY-4233 Change-Id: Id98a4e2805caf68a66dd5844f388c045f75a8865 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'integration/src')
-rwxr-xr-xintegration/src/main/scripts/release/releasePhase.sh15
-rwxr-xr-xintegration/src/main/scripts/release/updateRefs.sh20
-rwxr-xr-xintegration/src/main/scripts/reports/pf_status_report.sh77
3 files changed, 79 insertions, 33 deletions
diff --git a/integration/src/main/scripts/release/releasePhase.sh b/integration/src/main/scripts/release/releasePhase.sh
index e606ffb5..fd8397ff 100755
--- a/integration/src/main/scripts/release/releasePhase.sh
+++ b/integration/src/main/scripts/release/releasePhase.sh
@@ -374,12 +374,23 @@ release_phase_13() {
}
release_phase_14() {
- echo "Updating snapshots on policy/drools-applications, policy/gui . . ."
+ echo "Updating snapshots on policy/drools-applications, policy/gui and updating release data file . . ."
bumpSnapshots.sh \
-d "$release_data_file" \
-l "$repo_location" \
-i "$issue_id"
- echo "Updated snapshots on policy/drools-applications, policy/gui"
+ updateRefs.sh \
+ -f \
+ -d "$release_data_file" \
+ -l "$repo_location" \
+ -r "policy/parent"
+ generateCommit.sh \
+ -l "$repo_location" \
+ -r "policy/parent" \
+ -i "$issue_id" \
+ -e "update release data in policy/parent" \
+ -m "updated release data in policy/parent"
+ echo "Updated snapshots on policy/drools-applications, policy/gui and updated release data file"
}
case "$release_phase" in
diff --git a/integration/src/main/scripts/release/updateRefs.sh b/integration/src/main/scripts/release/updateRefs.sh
index 0f253f97..14f90d9a 100755
--- a/integration/src/main/scripts/release/updateRefs.sh
+++ b/integration/src/main/scripts/release/updateRefs.sh
@@ -54,6 +54,7 @@ usage()
echo " -o - update policy/drools-pdp references"
echo " -x - update policy/apex-pdp references"
echo " -k - update docker base images in Dockerfiles"
+ echo " -f - update release data in policy parent"
echo " -s - update release references to snapshot references,"
echo " if omitted, snapshot references are updated to release references"
echo ""
@@ -75,8 +76,9 @@ update_drools_pdp=false
update_apex_pdp=false
update_snapshot=false
update_docker=false
+update_file=false
-while getopts "hd:l:r:pcmoxks" opt
+while getopts "hd:l:r:pcmoxkfs" opt
do
case $opt in
h)
@@ -109,6 +111,9 @@ do
k)
update_docker=true
;;
+ f)
+ update_file=true
+ ;;
s)
update_snapshot=true
;;
@@ -411,3 +416,16 @@ then
exit 1
fi
fi
+
+if [ "$update_file" = true ]
+then
+ if [ ! "$target_repo" = "policy/parent" ]
+ then
+ echo "update of data file can only be done on the policy/parent repo"
+ exit 1
+ fi
+
+ echo "updating release data at $repo_location/$target_repo/integration/src/main/resources/release . . ."
+ cp "$release_data_file" "$repo_location/$target_repo"/integration/src/main/resources/release
+ echo "updated release data at $repo_location/$target_repo/integration/src/main/resources/release"
+fi
diff --git a/integration/src/main/scripts/reports/pf_status_report.sh b/integration/src/main/scripts/reports/pf_status_report.sh
index c979066c..539232ab 100755
--- a/integration/src/main/scripts/reports/pf_status_report.sh
+++ b/integration/src/main/scripts/reports/pf_status_report.sh
@@ -44,22 +44,30 @@ function health_check() {
curl -s --output "$health_report_temp_file" \
"https://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html"
- health_check_result=$(
- gunzip -c "$health_report_temp_file" | \
- grep 'window.output\["stats"\]' | \
- sed 's/},{/}\n{/g' | \
- grep health-policy | \
- sed -e 's/{//g' \
- -e 's/}//g' \
- -e 's/"//g' \
- -e 's/label://' | \
- awk -F',' '{printf("%s,%s,%s\n", $3,$4,$2)}'
- )
- report_day="${report_last_health%%_*}"
- report_hour_minute="${report_last_health#*_}"
- report_hour_minute="${report_hour_minute/-/:}"
- echo "$health_dir,$report_month-$report_day $report_hour_minute,$health_check_result"
+ if file "$health_report_temp_file" | grep -q gzip
+ then
+ health_check_result=$(
+ gunzip -c "$health_report_temp_file" | \
+ grep 'window.output\["stats"\]' | \
+ sed 's/},{/}\n{/g' | \
+ grep health-policy | \
+ sed -e 's/{//g' \
+ -e 's/}//g' \
+ -e 's/"//g' \
+ -e 's/label://' | \
+ awk -F',' '{printf("%s,%s,%s\n", $3,$4,$2)}'
+ )
+
+ report_day="${report_last_health%%_*}"
+ report_hour_minute="${report_last_health#*_}"
+ report_hour_minute="${report_hour_minute/-/:}"
+ printf "$health_dir,$report_month-$report_day $report_hour_minute,$health_check_result\n"
+ printf "\thttps://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html\n"
+ else
+ printf "$health_dir,$report_month-$report_day $report_hour_minute,result not available\n"
+ printf "\thttps://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html\n"
+ fi
}
echo ""
@@ -73,48 +81,57 @@ health_check onap_daily_pod4_master
jenkins_report_temp_file=$(mktemp)
-curl -s https://jenkins.onap.org/view/policy/ | \
+curl -s https://jenkins.onap.org/view/policy/ |
sed -e 's/<tr id=/\n<tr id=/g' \
- -e 's/><td data=/\n><td data=/g' | \
- grep 'tr id=' | \
+ -e 's/><td data=/\n><td data=/g' |
+ grep 'tr id=' |
sed -e 's/"//g' \
-e 's/<tr id=//' \
- -e 's/class= //' > "$jenkins_report_temp_file"
+ -e 's/class= //' |
+ grep '^job_' > "$jenkins_report_temp_file"
echo ""
echo "failing jobs"
echo "------------"
-grep "job-status-red" "$jenkins_report_temp_file" | \
+grep "job-status-red" "$jenkins_report_temp_file" |
grep -v stage |
- cut -f1 -d' '
+ cut -f1 -d' ' |
+ sed 's/_/\//' |
+ awk '{printf("https://jenkins.onap.org/%s\n", $1)}'
echo ""
echo "warning jobs"
echo "------------"
-grep "job-status-yellow" "$jenkins_report_temp_file" | \
+grep "job-status-yellow" "$jenkins_report_temp_file" |
grep -v clm |
- cut -f1 -d' '
+ cut -f1 -d' ' |
+ sed 's/_/\//' |
+ awk '{printf("https://jenkins.onap.org/%s\n", $1)}'
echo ""
echo "invalid jobs"
echo "------------"
-grep -v -E "(blue|red|yellow|verify|merge)" "$jenkins_report_temp_file" | \
- cut -f1 -d' '
+grep -v -E "(job-status-red|job-status-yellow|job-status-blue)" "$jenkins_report_temp_file" |
+ cut -f1 -d' ' |
+ sed 's/_/\//' |
+ awk '{printf("https://jenkins.onap.org/%s\n", $1)}'
echo ""
echo "bugs"
echo "----"
-curl -s https://jira.onap.org/issues/?jql=PROJECT%20%3D%20POLICY%20AND%20issuetype%20%3D%20Bug%20AND%20status%20!%3D%20Closed%20ORDER%20BY%20key%20ASC \ |
- grep 'data-issue-table-model-state' | \
+curl -s https://jira.onap.org/issues/?jql=PROJECT%20%3D%20POLICY%20AND%20issuetype%20%3D%20Bug%20AND%20status%20!%3D%20Closed%20ORDER%20BY%20key%20ASC |
+ grep 'data-issue-table-model-state' |
sed -e 's/&quot/\"/g' \
-e 's/.*";jiraHasIssues";:true,";page";:[0-9]*,";pageSize";:[0-9]*,";startIndex";:[0-9]*,";table";:\[//' \
-e 's/,";title";:";";,";total";:[0-9]*,";url";:";";,";sortBy";:\].*$//' \
- -e 's/}}/}}\n/g' | \
- grep 'POLICY-' | \
+ -e 's/}}/}}\n/g' |
+ grep 'POLICY-' |
sed -e 's/^.*key=/key=/g' \
-e 's/";:";/=/g' \
-e 's/";,";/,/g' \
-e 's/^.*key=/key=/g' \
- -e 's/";:{";description=.*$//'
+ -e 's/";:{";description=.*$//' \
+ -e 's/key=POLICY-\([0-9]*\),/https:\/\/jira.onap.org\/browse\/POLICY-\1 /'
+