Make jobs karaf-version specific, some duplicities
[releng/builder.git] / jjb / autorelease / include-raw-autorelease-get-integration-test-variables.sh
1 #!/bin/bash
2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2015, 2016 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11
12 # ODLNEXUSPROXY is used to define the location of the Nexus server used by the CI system.
13 # by default it should be set to https://nexus.opendaylight.org
14 # in cases where an internal ci system is using multiple NEXUS systems one for artifacts and another for staging,
15 # we can override using ODLNEXUS_STAGING_URL to route the staging build to the 2nd server.
16 # (most CI setups where a single Nexus server is used, ODLNEXUS_STAGING_URL should be left unset)
17 NEXUS_STAGING_URL=${ODLNEXUS_STAGING_URL:-$ODLNEXUSPROXY}
18
19 NEXUSURL=${NEXUS_STAGING_URL}/content/repositories/
20 VERSION=$(grep -m2 '<version>' "${WORKSPACE}/integration/distribution/${KARAF_ARTIFACT}/pom.xml" | tail -n1 | awk -F'[<|>]' '/version/ { printf $3 }')
21 echo "VERSION: ${VERSION}"
22 STAGING_REPO_ID=$(grep "Created staging repository with ID" "$WORKSPACE/deploy-staged-repository.log" | cut -d '"' -f2)
23 BUNDLE_URL="${NEXUSURL}/${STAGING_REPO_ID}/org/opendaylight/integration/${KARAF_ARTIFACT}/${VERSION}/${KARAF_ARTIFACT}-${VERSION}.zip"
24 echo STAGING_REPO_ID="$STAGING_REPO_ID" >> "$WORKSPACE/variables.prop"
25 echo BUNDLE_URL="$BUNDLE_URL" >> "$WORKSPACE/variables.prop"
26 echo "BUNDLE_URL: ${BUNDLE_URL}"
27
28 # Copy variables.prop to variables.jenkins-trigger so that the end of build
29 # trigger can pick up the file as input for triggering downstream jobs.
30 # This allows variables.prop to get archive to logs.opendaylight.org while not
31 # breaking the downstream trigger due to missing file from archiving.
32 cp variables.prop variables.jenkins-trigger