# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
-FILE_NAME=`echo $P2ZIP_URL | awk -F'/' '{ print $NF }'`
-VERSION=`echo $P2ZIP_URL | awk -F'/' '{ print $(NF-1) }'`
+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
-wget $P2ZIP_URL -O $FILE_NAME
+# 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 <<EOF
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<serverId>opendaylight-p2</serverId>
<repositoryUrl>https://nexus.opendaylight.org/service/local/repositories/p2repos/content-compressed</repositoryUrl>
<file>$FILE_NAME</file>
- <repositoryPath>org.opendaylight.$PROJECT/$VERSION</repositoryPath>
+ <repositoryPath>org.opendaylight.$PROJECT/$RELEASE_PATH</repositoryPath>
</configuration>
</execution>
</executions>
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
+# 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
<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>
- file-id: '{settings-file}'
variable: 'SETTINGS_FILE'
+- builder:
+ name: releng-fetch-p2zip-if-necessary
+ builders:
+ - shell: |
+ # Cleanup any existing zips and metadata before we download the new update site
+ rm -f *.zip *.xml
+ - conditional-step:
+ condition-kind: strings-match
+ condition-string1: '$P2ZIP_URL'
+ condition-string2: ''
+ condition-basedir: workspace
+ steps:
+ # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
+ - maven-target:
+ maven-version: '{maven-version}'
+ goals: 'org.apache.maven.plugins:maven-dependency-plugin:get org.apache.maven.plugins:maven-dependency-plugin:copy -V -B -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip -DoutputDirectory=$WORKSPACE'
+ settings: '{settings}'
+ global-settings: '{global-settings}'
+
- builder:
name: releng-generate-p2pom
builders:
name: releng-update-p2composite-metadata
builders:
- shell: !include-raw: include-raw-update-p2composite-metadata.sh
- - maven-target:
- maven-version: '{maven-version}'
- pom: 'deploy-composite-repo.xml'
- goals: 'clean deploy -V -Dmaven.repo.local=/tmp/r'
- settings: '{settings}'
- global-settings: '{global-settings}'
+ - conditional-step:
+ condition-kind: file-exists
+ condition-filename: deploy-composite-repo.xml
+ condition-basedir: workspace
+ steps:
+ - maven-target:
+ maven-version: '{maven-version}'
+ pom: 'deploy-composite-repo.xml'
+ goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
+ settings: '{settings}'
+ global-settings: '{global-settings}'
- builder:
name: releng-stage-release
prebuilders:
- wipe-org-opendaylight-repo
- jacoco-nojava-workaround
+ - releng-fetch-p2zip-if-necessary:
+ maven-version: '{mvn33}'
+ settings: '{project-settings}'
+ global-settings: '{odl-global-settings}'
- releng-generate-p2pom
maven:
maven-name: '{mvn33}'
root-pom: 'pom.xml'
- goals: 'clean deploy -V -Dmaven.repo.local=/tmp/r'
+ goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
settings: '{project-settings}'
global-settings: '{odl-global-settings}'
post-step-run-condition: UNSTABLE