Bug 483179: [SysML 1.4][releng] promote the rcp 

Change-Id: I7f51560c3f8c76e0597cf8e5c7f4e4226e7ba0db
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=483179
Signed-off-by: Francois Le Fevre - CEA <francois.le-fevre@cea.fr>
diff --git a/releng/org.eclipse.papyrus.sysml14.p2/publish.sh b/releng/org.eclipse.papyrus.sysml14.p2/publish.sh
index e783921..1796ffc 100755
--- a/releng/org.eclipse.papyrus.sysml14.p2/publish.sh
+++ b/releng/org.eclipse.papyrus.sysml14.p2/publish.sh
@@ -12,19 +12,14 @@
 # $5: Whether to merge the site with an existing one: (y)es, (n)o
 # $6: Whether to generate drop files: (y)es, (n)o
 # $7: The release label used to label the drop files and (nested) update site, e.g. 3.10.0 or 3.10.1
-# $8: An optional release label suffix to be appended to drop files and (nested) update site name, e.g. M1, RC1 
+# $8: The eclipse target version, e.g. mars or neon
+# $9: An optional release label suffix to be appended to drop files and (nested) update site name, e.g. M1, RC1 
 
 ##Additional variables to specify for each project
 
 #The root url that enables to find the job with ${hudsonJobRootUrl}/$jobName/$buildId
 hudsonJobRootUrl="https://hudson.eclipse.org/papyrus/job/"
 
-#The localization of the local build target update site
-targetUpdateSite="archive/releng/org.eclipse.papyrus.sysml14.p2/target/repository"
-
-#The feature to parse to retrieve the qualifierversion
-feature2Parse4QualifierVersion="org.eclipse.papyrus.sysml14.feature"
-
 #The specific localization
 hudsonRoot="/home/data/httpd/download.eclipse.org/"
 component="sysml14"
@@ -32,10 +27,17 @@
 remoteDropDir=${hudsonRoot}/${remoteUpdateSiteRoot}/downloads/drops/$dropDir
 remoteUpdateSite="${hudsonRoot}/${remoteUpdateSiteRoot}/${remoteSite}"
 
+#The feature to parse to retrieve the qualifierversion
+feature2Parse4QualifierVersion="org.eclipse.papyrus.${component}.feature"
+
+#The localization of the local build target update site
+targetUpdateSite="archive/releng/org.eclipse.papyrus.${component}.p2/target/repository"
+targetRCPRoot="archive/releng/org.eclipse.papyrus.${component}.product/target/products/org.eclipse.papyrus.${component}.product"
+
 #The publish.sh script may be used to publish the build results (update site). The script may be called
 #without parameters and prompts for everything it requires for publishing an update site, or it may be 
 #invoked with respective command line parameters.
-if [ $# -eq 7 -o $# -eq 8  ];
+if [ $# -eq 8 -o $# -eq 9  ];
 then
 	jobName=$1
 	echo "jobName: $jobName"
@@ -51,9 +53,11 @@
 	echo "dropFiles: $dropFiles"
 	releaseLabel=$7	
 	echo "releaseLabel: $releaseLabel"
-	if [ -n "$8" ];
+	eclipseTarget=$8	
+	echo "eclipseTarget: $eclipseTarget"
+	if [ -n "$9" ];
 	then
-		releaseLabelSuffix=$8
+		releaseLabelSuffix=$9
 		echo "releaseLabelSuffix: $releaseLabelSuffix"
 	fi
 else
@@ -94,15 +98,6 @@
 fi
 
 # Determine the local update site we want to publish to
-
-echo "toto"
-ls -la ~/.hudson/jobs/${jobName}/${buildId}
-echo "titi"
-ls -laR "~/.hudson/jobs/${jobName}/"
-echo "xxxxxxxxxxxxxxxxxxxxxx"
-ls -laR "~/.hudson/jobs/$jobName/builds/$buildId"
-
-
 jobDir=$(readlink -f ~/.hudson/jobs/${jobName}/builds/${buildId})
 if [ ! -d $jobDir ];
 then
@@ -115,9 +110,9 @@
 echo "jobDir=${jobDir}"
 echo "targetUpdateSite=${targetUpdateSite}"
 echo "localUpdateSite=${localUpdateSite}"
-#ls -la ${localUpdateSite}
-#ls -laR ${localUpdateSite}
 
+localRCPSiteRoot=${jobDir}/${targetRCPRoot}
+echo "localRCPSiteRoot=${localRCPSiteRoot}"
 
 echo "Publishing from local update site: $localUpdateSite"
 
@@ -243,8 +238,24 @@
     cd update-site
     zip -r ../$localDropDir/${component}-Update-${releaseLabel}${releaseLabelSuffix}.zip features plugins artifacts.jar content.jar
     md5sum ../$localDropDir/${component}-Update-${releaseLabel}${releaseLabelSuffix}.zip > ../$localDropDir/${component}-Update-${releaseLabel}${releaseLabelSuffix}.zip.md5
-    echo "Created ${component}-Update-Site-${releaseLabel}${releaseLabelSuffix}.zip" 
+    echo "Created ${component}-Update-${releaseLabel}${releaseLabelSuffix}.zip" 
     cd .. 
+    
+    #Manage RCP
+    rcpDir="$localDropDir/${eclipseTarget}/RCP-${releaseLabel}${releaseLabelSuffix}"
+    
+    mkdir -p ${rcpDir}
+    cd update-site
+    cp ${localRCPSiteRoot}-linux.gtk.x86_64.zip ../${rcpDir}/${component}-RCP-${releaseLabel}${releaseLabelSuffix}-linux.gtk.x86_64.zip
+    md5sum ../${rcpDir}/${component}-RCP-${releaseLabel}${releaseLabelSuffix}-linux.gtk.x86_64.zip > ../${rcpDir}/${component}-RCP-${releaseLabel}${releaseLabelSuffix}-linux.gtk.x86_64.zip.md5
+    echo "Created ${component}-RCP-${releaseLabel}${releaseLabelSuffix}-linux.gtk.x86_64.zip for ${eclipseTarget} in ${rcpDir}" 
+    
+    #cp ${localRCPSiteRoot}-macosx.cocoa.x86_64.tar.gz ../${rcpDir}/${component}-RCP-${releaseLabel}${releaseLabelSuffix}-macosx.cocoa.x86_64.tar.gz
+    #md5sum ../${rcpDir}/${component}-RCP-${releaseLabel}${releaseLabelSuffix}-macosx.cocoa.x86_64.tar.gz  > ../${rcpDir}/${component}-RCP-${releaseLabel}${releaseLabelSuffix}-macosx.cocoa.x86_64.tar.gz.md5
+    #echo "Created ${component}-RCP-${releaseLabel}${releaseLabelSuffix}-macosx.cocoa.x86_64.tar.gz  for ${eclipseTarget} in ${rcpDir}"  
+    #cp ${localRCPSiteRoot}-win32.win32.x86_64.zip ../${rcpDir}/${component}-RCP-${releaseLabel}${releaseLabelSuffix}-win32.win32.x86_64.zip
+    #md5sum ../${rcpDir}/${component}-RCP-${releaseLabel}${releaseLabelSuffix}-win32.win32.x86_64.zip > ../${rcpDir}/${component}-RCP-${releaseLabel}${releaseLabelSuffix}-win32.win32.x86_64.zip.md5
+    #echo "Created ${component}-RCP-${releaseLabel}${releaseLabelSuffix}-win32.win32.x86_64.zip for ${eclipseTarget} in ${rcpDir}"  
 
     # Cleanup local update site (for drop files generation)
 	rm -fr update-site