blob: 5eb45e7c2d25e58985bdcf2d852ab8ba6802794e [file] [log] [blame]
#--------------------------------------------------------------------------------
# Copyright (c) 2012-2016 CEA LIST.
#
#
# 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
#
# Contributors:
# Celine Janssens (All4Tec)
#--------------------------------------------------------------------------------
#!/bin/sh
# Archive Phase
# Only if required
echo "* Copy Archive ZIP"
echo "* Archive URL = ${ARCHIVE_URL}"
p2UpdateSiteDir=${WORKSPACE}/repository
if [ -n "${ARCHIVE_URL}" ]; then
downloadsArea= ${ARCHIVE_URL}
case $UPDATE_SITE in
"nightly") typeLetter = N;;
"milestones") typeLetter = M ;;
"integration") typeLetter = I";;
"releases") typeLetter = R;;
*) echo "Sorry, The UPDATE_SITE variable is not correct !";;
esac
echo "* Build ID = $BUILD_ID"
COMPACT_BUILD_ID="${BUILD_ID//[-_]}"
COMPACT_BUILD_ID="${COMPACT_BUILD_ID:0:12}"
FULL_BUILD_ID=${typeLetter}${COMPACT_BUILD_ID}
# set zip file name
if [ -n "$BUILD_ALIAS" ]; then
updateZipFile="Papyrus-RT-Update-${BUILD_ALIAS}.zip"
else
updateZipFile="Papyrus-RT-Update-${FULL_BUILD_ID}.zip"
fi
#Archive directory path (ie: download.eclipse.org/papyrus-rt/downloads/drops/0.8.0/N201605210600)
archiveDir=$downloadsArea/${REPO_VERSION}
mkdir -p "$archiveDir/$FULL_BUILD_ID"
finalArchiveDir=$archiveDir/$FULL_BUILD_ID
# duplicate the archive with the full name
cp Papyrus-RT.zip $updateZipFile
# Move it to the Remote Location
mv $updateZipFile $finalArchiveDir
fi