3 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
4 ##############################################################################
5 # Copyright (c) 2016 The Linux Foundation and others.
7 # All rights reserved. This program and the accompanying materials
8 # are made available under the terms of the Eclipse Public License v1.0
9 # which accompanies this distribution, and is available at
10 # http://www.eclipse.org/legal/epl-v10.html
11 ##############################################################################
13 # Force any errors to cause the script to end with failure
16 function print_usage {
17 echo "Usage: $0 <staging-repo>"
19 echo " <staging-repo> : The Nexus staging repo ID to sign."
28 SIGNATURES_DIR="gpg-signatures"
29 TMPFILE=/tmp/project-list.txt
31 wget -q https://nexus.opendaylight.org/content/repositories/$SIGNREPO/org/opendaylight/ -O $TMPFILE
32 PROJECTS=`grep '/</a>' $TMPFILE | sed -e 's#/</a>.*##' -e 's#.*/">##'`
33 echo "Projects detected: $PROJECTS"
36 # Prepare staging repo to upload signatures to
39 if [ -d "$SIGNATURES_DIR" ]; then
40 echo "$SIGNATURES_DIR directory exists. Clearing..."
41 rm -rf $SIGNATURES_DIR
45 mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy-staged-repository \
46 -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
47 -DskipStagingRepositoryClose=true \
48 -DrepositoryDirectory="$SIGNATURES_DIR" \
49 -DnexusUrl=https://nexus.opendaylight.org/ \
50 -DstagingProfileId="425e43800fea70" \
51 -DserverId="opendaylight.staging" | tee /tmp/deploy-staged-repository.log
53 STAGED_REPO_ID=`grep 'Created staging repository with ID' /tmp/deploy-staged-repository.log | sed -e 's/.*ID "//' -e 's/".*//'`
54 echo "Staged Repo: $STAGED_REPO_ID"
57 # Finally retrieve and sign artifacts.
63 ./odlrelease sign http://nexus.opendaylight.org/content/repositories/$SIGNREPO/org/opendaylight/$i/
64 mvn org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy-staged-repository \
65 -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
66 -DskipStagingRepositoryClose=true \
67 -DstagingRepositoryId=$STAGED_REPO_ID \
68 -DrepositoryDirectory="$SIGNATURES_DIR" \
69 -DnexusUrl=https://nexus.opendaylight.org/ \
70 -DstagingProfileId="425e43800fea70" \
71 -DserverId="opendaylight.staging"