Add new project section for release notes
[releng/builder.git] / jjb / include-raw-update-p2composite-metadata.sh
index f4223af4a137feab5b9faad7d107ff576868ee09..5e11e3af9ce2f0380729f030eb74dc101e3ac6dc 100644 (file)
@@ -9,15 +9,25 @@
 # http://www.eclipse.org/legal/epl-v10.html
 ##############################################################################
 
-EPOCH_DATE=`date +%s%3N`
-MVN_METADATA=`echo $P2ZIP_URL | sed 's,/*[^/]\+/*$,,' | sed 's,/*[^/]\+/*$,,'`/maven-metadata.xml
+# If we detect a snapshot build then there is no need to run this script.
+# YangIDE has indicated that the only want the latest snapshot released to
+# the snapshot directory.
+if echo "$P2ZIP_URL" | grep opendaylight.snapshot; then
+    exit 0
+fi
+if [[ "$P2ZIP_URL" == "" ]]; then
+    exit 0
+fi
+
+EPOCH_DATE=$(date +%s%3N)
+MVN_METADATA=$(echo "$P2ZIP_URL" | sed 's,/*[^/]\+/*$,,' | sed 's,/*[^/]\+/*$,,')/maven-metadata.xml
 P2_COMPOSITE_ARTIFACTS=compositeArtifacts.xml
 P2_COMPOSITE_CONTENT=compositeContent.xml
 
-wget $MVN_METADATA -O maven-metadata.xml
+wget "$MVN_METADATA" -O maven-metadata.xml
 
-VERSIONS=`xmlstarlet sel -t -m "/metadata/versioning/versions" -v "version" maven-metadata.xml`
-NUM_VERSIONS=`echo $VERSIONS | wc -w`
+VERSIONS=$(xmlstarlet sel -t -m "/metadata/versioning/versions" -v "version" maven-metadata.xml)
+NUM_VERSIONS=$(echo "$VERSIONS" | wc -w)
 
 
 ##
@@ -109,7 +119,7 @@ cat > deploy-composite-repo.xml <<EOF
               <serverId>opendaylight-p2</serverId>
               <repositoryUrl>https://nexus.opendaylight.org/service/local/repositories/p2repos/content-compressed</repositoryUrl>
               <file>composite-repo.zip</file>
-              <repositoryPath>org.opendaylight.$PROJECT</repositoryPath>
+              <repositoryPath>org.opendaylight.$PROJECT/release</repositoryPath>
             </configuration>
           </execution>
         </executions>