3 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Copied (and modified slightly) from edgexfoundry
18 # Do not fail this job as this is a stopgap for now.
21 # Look in our console log for the triggering build number
23 curl $BUILD_URL/consoleText | grep "Started by upstream project" > $T
26 # $T should contain "06:25:53 Started by upstream project "projname" build number 111"
27 upstream_name=$( awk -F '"' '{print $2}' < $T)
28 upstream_number=$( awk -F '"' '{print $3}' < $T | awk -F ' ' '{print$3}')
30 # This is the URL of the console log for the triggering job
31 upstream_url="https://jenkins.akraino.org/job/$upstream_name/$upstream_number/consoleText"
33 # This identifies the staging directory for the staging URL
34 # https://nexus.akraino.org/content/repositories/autostaging-${AUTOSTAGING}/org/akraino/${PROJECT}/${VERSION}/${PROJECT}-${VERSION}.[jw]ar
36 # https://nexus.akraino.org/content/repositories/autostaging-${AUTOSTAGING}/${PROJECT}-${VERSION}.tgz
38 # https://nexus.akraino.org/content/repositories/autostaging-1100/org/akraino/portal_user_interface/0.0.2/portal_user_interface-0.0.2.war
39 # https://nexus.akraino.org/content/repositories/autostaging-1099/org/akraino/camunda_workflow/0.0.2/camunda_workflow-0.0.2.jar
40 # https://nexus.akraino.org/content/repositories/autostaging-1091/airshipinabottle_deploy-0.0.1.tgz
41 AUTOSTAGING=$(curl $upstream_url | grep "Completed uploading files to autostaging" | sed 's/.*-//' | tr -d '.')