Merge "Nexus retirement CI job clean up"
[ci-management.git] / jjb / scripts / publish_logs.sh
1 #!/bin/bash
2
3 # Copyright (c) 2021 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 echo "---> publish_logs.sh"
17
18 PYTHON_SCRIPT="/w/workspace/publish_library.py"
19
20 mkdir -p "$WORKSPACE/archives"
21
22 s3_path="$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER/"
23
24 echo "INFO: S3 path $s3_path"
25
26 echo "INFO: archiving logs to S3"
27 python3 $PYTHON_SCRIPT deploy_s3 "$S3_BUCKET" "$s3_path" \
28     "$BUILD_URL" "$WORKSPACE"
29
30 echo "S3 build logs: <a href=\"https://$CDN_URL/$s3_path\">https://$CDN_URL/$s3_path</a>"