Skip to content
François Garillot edited this page Jan 16, 2013 · 5 revisions

Configuration of the job on Jenkins (2013-01-15-12:45)

LOCAL_REPO=`pwd`/m2repo

# generating the build

TIMESTAMP=`date '+%Y%m%d-%H%M'`

cd ecosystem
mvn -Dmaven.repo.local=${LOCAL_REPO} -Pecosystem-builds exec:java

# push the build report

scp target/builds.html scalaide@scala-ide.dreamhosters.com:scala-ide.dreamhosters.com/ecosystem/builds-${TIMESTAMP}.html
ssh scalaide@scala-ide.dreamhosters.com rm -f scala-ide.dreamhosters.com/ecosystem/builds.html
ssh scalaide@scala-ide.dreamhosters.com ln -s builds-${TIMESTAMP}.html scala-ide.dreamhosters.com/ecosystem/builds.html

# checking if there is anything to build

if [ ! -f target/builds/pom.xml ]
then
  echo "Nothing to do"
  exit 0
fi

echo "Let's build"

cd target/builds
# This used to work, but now it break badly: https://jenkins.scala-ide.org:8496/jenkins/job/ecosystem-all/98/console
mvn -Dmaven.repo.local=${LOCAL_REPO} clean package -Pbuild
mvn -Dmaven.repo.local=${LOCAL_REPO} clean package -Ppackage

ZIP_FILE=site_assembly-${TIMESTAMP}.zip
UPDATE_SITE_FILE=update-site.zip

# publish if exists
# $1 local folder
# $2 remote location
publish() {
  if [ -d $1 ]
  then
    LOCAL_FOLDER=$1
    SITE_LOCATION=ecosystem/$2

    cd ${LOCAL_FOLDER}/target
    ssh scalaide@scala-ide.dreamhosters.com mkdir -p scala-ide.dreamhosters.com/${SITE_LOCATION}
    zip -r ${ZIP_FILE} site
    scp ${ZIP_FILE} scalaide@scala-ide.dreamhosters.com:scala-ide.dreamhosters.com/${SITE_LOCATION}
    ssh scalaide@scala-ide.dreamhosters.com rm -rf scala-ide.dreamhosters.com/${SITE_LOCATION}/site
    ssh scalaide@scala-ide.dreamhosters.com "cd scala-ide.dreamhosters.com/${SITE_LOCATION}; unzip ${ZIP_FILE}"
    cd ../..
  fi
}

# publish zip if data exists
# $1 local folder
# $2 remote location
publishZip() {
  if [ -d $1 ]
  then
    LOCAL_FOLDER=$1
    SITE_LOCATION=ecosystem/$2

    cd ${LOCAL_FOLDER}/target
    ssh scalaide@scala-ide.dreamhosters.com mkdir -p scala-ide.dreamhosters.com/${SITE_LOCATION}
    zip -r ${UPDATE_SITE_FILE} site
    scp ${UPDATE_SITE_FILE} scalaide@scala-ide.dreamhosters.com:scala-ide.dreamhosters.com/${SITE_LOCATION}
    ssh scalaide@scala-ide.dreamhosters.com "cd scala-ide.dreamhosters.com/${SITE_LOCATION}; sha1sum ${UPDATE_SITE_FILE} > ${UPDATE_SITE_FILE}.sha1"
    cd ../..
  fi
}

publish dev-scala29-e37-base e37/scala29/dev

publish dev-scala210-e37-base e37/scala210/dev

publish dev-scala29-e38-base e38/scala29/dev

publish dev-scala210-e38-base e38/scala210/dev

publish dev-scala29-e37-next next/e37/scala29/dev

publish dev-scala210-e37-next next/e37/scala210/dev

publish dev-scala29-e38-next next/e38/scala29/dev

publish dev-scala210-e38-next next/e38/scala210/dev

publishZip dev-scala29-e37-base-zip e37/scala29/dev

publishZip dev-scala210-e37-base-zip e37/scala210/dev

publishZip dev-scala29-e38-base-zip e38/scala29/dev

publishZip dev-scala210-e38-base-zip e38/scala210/dev