| #!/bin/sh |
| #Move the generated p2 repository to its location on download.eclipse.org/jetty/updates |
| pwd |
| |
| #export platform (indigo-milestone, indigo-milestone-dev, indigo-nightly) |
| #export rt_release_version |
| |
| [ -z "$deploymentdir_parent" ] && deploymentdir_parent="/home/data/httpd/download.eclipse.org/jetty/updates" |
| if [ "$platform" = "indigo-milestone" ]; then |
| deploymentdir_name="jetty-rt-3.7milestones" |
| elif [ "$platform" = "indigo-milestone-dev" -o "$platform" = "indigo-nightly" ]; then |
| deploymentdir_name="jetty-rt-3.7-N-builds" |
| else |
| echo "Unknown platform $platform" |
| exit 12 |
| fi |
| deploymentdir="$deploymentdir_parent/$deploymentdir_name" |
| if [ ! -d "$deploymentdir" ]; then |
| echo "Unable to find the deployment directory $deploymentdir" |
| exit 12 |
| fi |
| |
| builtrepodir="jetty-features/org.eclipse.jetty.product/target/repository" |
| if [ ! -d "$builtrepodir/plugins/" ]; then |
| echo "Unable to find the built repository directory $builtrepodir" |
| exit 12 |
| fi |
| jetty_util=`find $builtrepodir/plugins/org.eclipse.jetty.util_*.jar` |
| if [ -z "$jetty_util" ]; then |
| echo "Unable to locate 'org.eclipse.jetty.util_*.jar' the repository was not built correctly." |
| exit 12; |
| fi |
| jetty_version_built=`echo "$jetty_util" | sed -nr 's/.*util_(.*)(\.jar)/\1/p'` |
| echo "version built $jetty_version_built" |
| |
| jetty_version_used=$jetty_version_built |
| if [ -z "$rt_release_version" ]; then |
| echo "SNAPSHOT build: deploy in the 'development' folder." |
| jetty_version_built="development" |
| else |
| #Compute the qualifier using a feature and append it to the rt_release_version: |
| #so S-3.7-RC4 becomes S-3.7-RC4-201105301339 for example |
| jetty_core=`find $builtrepodir/features/org.eclipse.jetty.core_*.jar` |
| if [ -z "$jetty_core" ]; then |
| echo "Unable to locate 'features/org.eclipse.jetty.core_*.jarfeatures/org.eclipse.jetty.core_*.jar' the repository was not built correctly." |
| exit 12; |
| fi |
| jetty_core_qualifier=`echo "$jetty_core" | sed -nr 's/.*core_.*\.(.*)(\.jar)/\1/p'` |
| echo "The qualifier of the features built here: $jetty_core_qualifier" |
| jetty_version_built="$rt_release_version-$jetty_core_qualifier" |
| fi |
| |
| |
| #echo "Place the product archives inside the repository" |
| #A product archive looks like this: EclipseRTWebStarterKit-3.7.0.201105292308-linux.gtk.x86.tar.gz |
| #product_file=`find jetty-features/org.eclipse.jetty.product/target/EclipseRTWebStarterKit-*-linux.gtk.x86.tar.gz` |
| #if [ -z "$product_file" ]; then |
| # echo "Unable to locate 'EclipseRTWebStarterKit-*-linux.gtk.x86.tar.gz' there was no product archive." |
| # exit 12; |
| #fi |
| #product_version_built=`echo "$product_file" | sed -nr 's/.*EclipseRTWebStarterKit-(.*)(-linux\.gtk\.x86\.tar\.gz)/\1/p'` |
| #echo "product built $product_file" |
| #echo "version built $product_version_built" |
| #Also copy the windows version to get a zip arcchive: |
| #product_file_win32=`find jetty-features/org.eclipse.jetty.product/target/EclipseRTWebStarterKit-*-win32.win32.x86.zip` |
| #if [ -z "$product_file_win32" ]; then |
| # echo "Unable to locate 'EclipseRTWebStarterKit-*-win32.win32.x86.zip' there was no product archive." |
| # exit 12; |
| #fi |
| |
| #product_file_name="EclipseRTWebStarterKit-"$product_version_built".tar.gz" |
| #product_file_zip_name="EclipseRTWebStarterKit-"$product_version_built".zip" |
| #repository_archive_file_name="EclipseRTWebStarterKit-repository-"$product_version_built".zip" |
| #curr_dir=`pwd` |
| #cd jetty-features/org.eclipse.jetty.product/target |
| #[ -d "$repository_archive_file_name" ] && rm "$repository_archive_file_name" |
| #zip -r "$repository_archive_file_name" repository |
| #cd $curr_dir |
| |
| #mv jetty-features/org.eclipse.jetty.product/target/$repository_archive_file_name $builtrepodir/ |
| #cp $product_file $builtrepodir/$product_file_name |
| #cp $product_file_win32 $builtrepodir/$product_file_zip_name |
| |
| |
| echo "Generating the index.html" |
| #For the synthax of the html template see http://stackoverflow.com/questions/1609423/using-sed-to-expand-environment-variables-inside-files |
| |
| deploymentdir_absolute_href="/jetty/updates/$deploymentdir_name/$jetty_version_built" |
| software_site_url=http://download.eclipse.org${deploymentdir_absolute_href} |
| product_file_href="http://www.eclipse.org/downloads/download.php?file=$deploymentdir_absolute_href/$product_file_name" |
| product_file_zip_href="http://www.eclipse.org/downloads/download.php?file=$deploymentdir_absolute_href/$product_file_zip_name" |
| repository_archive_file_href="http://www.eclipse.org/downloads/download.php?file=$deploymentdir_absolute_href/$repository_archive_file_name" |
| timestamp=`date` |
| export software_site_url deploymentdir_absolute_href repository_archive_file_name repository_archive_file_href product_file_href product_file_zip_href product_version_built product_file_name product_file_zip_name jetty_version_used platform timestamp |
| env | sed 's/[\%]/\\&/g;s/\([^=]*\)=\(.*\)/s%${\1}%\2%/;/^s/!d' > sed.script |
| cat index-tpl.html | sed -f sed.script > $builtrepodir/index.html |
| |
| if [ -d "$deploymentdir/$jetty_version_built" ]; then |
| rm -rf $deploymentdir/$jetty_version_built |
| fi |
| mkdir -p $deploymentdir/$jetty_version_built |
| |
| echo "Deploying the generated p2 repository in $deploymentdir/$jetty_version_built" |
| cp -r $builtrepodir/* $deploymentdir/$jetty_version_built |
| #Make sure that the rt.jetty group of users can tweak things eventually. Ignore errors. |
| set +e |
| chmod -R g+rw $deploymentdir/$jetty_version_built |
| set -e |
| |
| #Re-generate the composite repository |
| [ -f "$deploymentdir/index.sh" ] && $deploymentdir/index.sh |
| |
| |
| |