f9acf7c532da1a55ec69aac7c11ed95d16daf587
[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 # Job will pass in a variable ${DATESTAMP} if this variable is false than we
13 # we are likely releasing a release candidate. We should skip closing the
14 # Nexus staging repository so that we can sign the artifacts.
15 SKIP_STAGING_CLOSE=false
16 if [ "${DATESTAMP}" == "false" ]
17 then
18     SKIP_STAGING_CLOSE=true
19 fi
20
21 mkdir -p hide/from/pom/files
22 cd hide/from/pom/files
23 mkdir -p m2repo/org/opendaylight/
24
25 (IFS='
26 '
27 for m in `xmlstarlet sel -N x=http://maven.apache.org/POM/4.0.0 -t -m '//x:modules' -v '//x:module' ../../../../pom.xml`; do
28     rsync -avz --exclude 'maven-metadata-local.xml' \
29                --exclude 'maven-metadata-*' \
30                --exclude '_remote.repositories' \
31                --exclude 'resolver-status.properties' \
32                "/tmp/r/org/opendaylight/$m" m2repo/org/opendaylight/
33 done)
34
35 # Add exception for integration project since they release under the
36 # integration top-level project.
37 rsync -avz --exclude 'maven-metadata-local.xml' \
38            --exclude 'maven-metadata-*' \
39            --exclude '_remote.repositories' \
40            --exclude 'resolver-status.properties' \
41            "/tmp/r/org/opendaylight/integration" m2repo/org/opendaylight/
42
43 mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.2:deploy-staged-repository \
44     -DskipStagingRepositoryClose=${SKIP_STAGING_CLOSE} \
45     -DrepositoryDirectory="`pwd`/m2repo" \
46     -DnexusUrl=http://nexus.opendaylight.org/ \
47     -DstagingProfileId="425e43800fea70" \
48     -DserverId="opendaylight.staging" \
49     -s $SETTINGS_FILE \
50     -gs $GLOBAL_SETTINGS_FILE | tee $WORKSPACE/deploy-staged-repository.log