#!/bin/bash # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2016 The Linux Foundation and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## if [[ "$P2ZIP_URL" == "" ]]; then P2ZIP_URL=opendaylight.snapshot/$(find . -name "*.zip" -type f -exec ls "{}" + | head -1) FILE_NAME=$(echo "$P2ZIP_URL" | awk -F'/' '{ print $NF }') RELEASE_PATH="snapshot" else FILE_NAME=$(echo "$P2ZIP_URL" | awk -F'/' '{ print $NF }') VERSION=$(echo "$P2ZIP_URL" | awk -F'/' '{ print $(NF-1) }') RELEASE_PATH="release/$VERSION" wget --quiet "$P2ZIP_URL" -O "$FILE_NAME" fi # If we detect a snapshot build then release to a snapshot repo # YangIDE has indicated that the only want the latest snapshot released to # the snapshot directory. if echo "$P2ZIP_URL" | grep opendaylight.snapshot; then RELEASE_PATH="snapshot" fi cat > "${WORKSPACE}/pom.xml" < 4.0.0 org.opendaylight.$PROJECT p2repo 1.0.0-SNAPSHOT pom org.apache.maven.plugins maven-deploy-plugin 2.8.2 true org.sonatype.plugins maven-upload-plugin 0.0.1 publish-site deploy upload-file opendaylight-p2 https://nexus.opendaylight.org/service/local/repositories/p2repos/content-compressed $FILE_NAME org.opendaylight.$PROJECT/$RELEASE_PATH EOF