Chore: migrate some scripts shebang to sh
[releng/builder.git] / jjb / autorelease / autorelease-get-integration-test-variables.sh
1 #!/bin/sh
2 # SPDX-License-Identifier: 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 "$NEXUS_STAGING_URL" "$WORKSPACE/archives/staging-repo.txt" | awk '{print $1}')
23 BUNDLE_URL="${NEXUSURL}/${STAGING_REPO_ID}/org/opendaylight/integration/${KARAF_ARTIFACT}/${VERSION}/${KARAF_ARTIFACT}-${VERSION}.zip"
24 # shellcheck disable=SC2129
25 echo STAGING_REPO_ID="$STAGING_REPO_ID" >> "$WORKSPACE/variables.prop"
26 echo BUNDLE_URL="$BUNDLE_URL" >> "$WORKSPACE/variables.prop"
27 echo KARAF_VERSION="$KARAF_VERSION" >> "$WORKSPACE/variables.prop"
28 echo "BUNDLE_URL: ${BUNDLE_URL}"
29
30 # Copy variables.prop to variables.jenkins-trigger so that the end of build
31 # trigger can pick up the file as input for triggering downstream jobs.
32 # This allows variables.prop to get archive to logs.opendaylight.org while not
33 # breaking the downstream trigger due to missing file from archiving.
34 cp variables.prop variables.jenkins-trigger