3efacf878afb88f311de94852a22d46651eb8944
[releng/builder.git] / jjb / autorelease / include-raw-autorelease-maven-deploy.sh
1 #!/bin/bash
2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2015 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 # Assuming that mvn deploy created the hide/from/pom/files/stage directory.
13 cd hide/from/pom/files || exit 1
14 mkdir -p m2repo/org/opendaylight/
15
16 # ODLNEXUSPROXY is used to define the location of the Nexus server used by the CI system.
17 # by default it should be set to https://nexus.opendaylight.org
18 # in cases where an internal ci system is using multiple NEXUS systems one for artifacts and another for staging,
19 # we can override using ODLNEXUS_STAGING_URL to route the staging build to the 2nd server.
20 # (most CI setups where a single Nexus server is used, ODLNEXUS_STAGING_URL should be left unset)
21 NEXUS_STAGING_URL=${ODLNEXUS_STAGING_URL:-$ODLNEXUSPROXY}
22 NEXUS_STAGING_PROFILE=${ODLNEXUS_STAGING_PROFILE:-425e43800fea70}
23 NEXUS_STAGING_SERVER_ID=${ODLNEXUS_STAGING_SERVER_ID:-"opendaylight.staging"}
24
25 rsync -avz --remove-source-files \
26            --exclude 'maven-metadata*' \
27            --exclude '_remote.repositories' \
28            --exclude 'resolver-status.properties' \
29            "stage/org/opendaylight" m2repo/org/
30
31 "$MVN" -V -B org.sonatype.plugins:nexus-staging-maven-plugin:1.6.2:deploy-staged-repository \
32     -DrepositoryDirectory="$(pwd)/m2repo" \
33     -DnexusUrl="$NEXUS_STAGING_URL" \
34     -DstagingProfileId="$NEXUS_STAGING_PROFILE" \
35     -DserverId="$NEXUS_STAGING_SERVER_ID" \
36     -s "$SETTINGS_FILE" \
37     -gs "$GLOBAL_SETTINGS_FILE" | tee "$WORKSPACE/deploy-staged-repository.log"