From 328544530d4cc2f3ed775223c516b2c265600b92 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Thu, 26 Feb 2015 16:38:29 -0800 Subject: Publish to sonatype staging. Simplified while I was at it. --- scripts/jobs/integrate/bootstrap | 139 +-------------------------------------- 1 file changed, 2 insertions(+), 137 deletions(-) diff --git a/scripts/jobs/integrate/bootstrap b/scripts/jobs/integrate/bootstrap index afa5f76042..f05daae399 100755 --- a/scripts/jobs/integrate/bootstrap +++ b/scripts/jobs/integrate/bootstrap @@ -1,85 +1,14 @@ #!/bin/bash -e - - # NOTE: this is a quick backport of the 2.11.x script to 2.10.x -- some comments may be out dated - - -# TODO: different scripts for the different phases -- usually we don't need to bootstrap the modules, -# since we can use the previous version of scala for STARR as well as for compiling the modules (assuming it's binary compatible) -# We should move away from the complicated bootstrap and set up our release schedule so we always have a previous build that satisfies these criteria. -# (Potentially trivially, by splitting up this script, and publishing locker as if it were a real release.) - # requirements: -# sbtCmd must point to sbt from sbt-extras (this is the standard on the Scala jenkins, so we only support that one) # - ~/.sonatype-curl that consists of user = USER:PASS -# - ~/.m2/settings.xml with credentials for sonatype - # - # private-repo - # jenkinside - # - # # - ~/.credentials (for sonatype) # realm=Sonatype Nexus Repository Manager # host=oss.sonatype.org # user=lamp # password= -# - ~/.credentials-private-repo for private-repo.typesafe.com, as follows: - # realm=Artifactory Realm - # host=private-repo.typesafe.com - # user=jenkinside - # password= -# - ~/.sbt/0.13/plugins/gpg.sbt with: -# addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1") - -# Modus operandi: -# -# Determine Scala version as: -# -# $SCALA_VER_BASE$SCALA_VER_SUFFIX (if former variable is set) -# By parsing the tag (if HEAD is tagged as v$base$suffix) -# By parsing build.number for the base version, suffixing with -$sha-nightly -# Serialize these versions to jenkins.properties, which are passed downstream to scala-release-2.11.x-dist. -# This also removes the need to tag scala/scala-dist (not possible for nightlies, still encouraged for releases, but not a hard requirement). -# -# Determine Module Versions -# -# When running in "versions.properties" mode (the default), derive tags from these versions and build, publishing only those modules that are not available yet. -# Otherwise, build HEAD for all modules, derive a -nightly version for them. -# Bootstrap: -# -# Build minimal core of Scala as this version (aka locker), publish to private-repo -# Build modules required to bootstrap, publish to private-repo -# Build Scala using the previously built core and bootstrap modules, publish to private-repo This overwrites the minimal core on private-repo -# Stage to sonatype (unless building a -nightly release): -# -# Stage this Scala build on sonatype -# Rebuild modules with this Scala build, and stage them on sonatype as well -# This script can be run in multiple modes. It is design to work without any input, -# so that it could be run in Travis CI. In that mode, it'll build a release when -# the current HEAD of the checkout in $WORKSPACE is tagged, and stage to sonatype. Otherwise, -# it'll build a nightly. -# -# Since the nightlies are intended to be a drop in replacement, all modules are built with the -# full Scala version as their binary version, so that you can just set scalaVersion to the -# nightly's sha-derived version and be good to go. -# -# The other way to trigger a release is by setting the SCALA_VER_BASE env var. -# -# By default, we build the versions of the modules as specified by versions.properties -# (as specified in the HEAD commit). Set moduleVersioning to something random -# to trigger building HEAD of each module, generating a fresh -$(git describe)-nightly version for each. -# -# PS: set publishToSonatype to anything but "yes" to avoid publishing to sonatype -# (publishing only done when $WORKSPACE checkout's HEAD is tagged / SCALA_VER_BASE is set.) - - -sbtCmd=${sbtCmd-sbt} # TESTING (this is a marker for defaults to change when testing locally: should be sbtx on my mac) - -# 0.13.5 does not respect "set every scalaVersion", see -# https://github.com/scala/scala-parser-combinators/pull/27 -sbtCmd="$sbtCmd -sbt-version 0.13.2" # publishToSonatype # set to anything but "yes" to avoid publishing to sonatype @@ -90,36 +19,7 @@ baseDir=${WORKSPACE-`pwd`} scriptsDir="$baseDir/scripts" . $scriptsDir/common -# we must change ivy home to get a fresh ivy cache, otherwise we get half-bootstrapped scala -# rm it in case it existed (and there's no ivy2-shadow, which indicates we're running in a TESTING environment)... -# we don't nuke the whole ws since that clobbers the git clones needlessly -[[ -d $baseDir/ivy2-shadow ]] || rm -rf $baseDir/ivy2 -mkdir -p $baseDir/ivy2 - -rm -rf $baseDir/resolutionScratch_ -mkdir -p $baseDir/resolutionScratch_ - -# repo used to publish "locker" scala to (to start the bootstrap) -privateCred="private-repo" -privateRepo="http://private-repo.typesafe.com/typesafe/scala-release-temp/" - -##### git -gfxd() { - git clean -fxd # TESTING -} - -update() { - [[ -d $baseDir ]] || mkdir -p $baseDir - cd $baseDir - - if [ ! -d $baseDir/$2 ]; then git clone "https://github.com/$1/$2.git"; fi - cd $2 - - git fetch --tags "https://github.com/$1/$2.git" - (git fetch "https://github.com/$1/$2.git" $3 && git checkout -q FETCH_HEAD) #|| git checkout -q $3 # || fallback is for local testing on tag - git reset --hard -} ##### sonatype interface @@ -146,28 +46,6 @@ function st_stagingRepoClose() { } -# ARGH trying to get this to work on multiple versions of sbt-extras... -# the old version (on jenkins, and I don't want to upgrade for risk of breaking other builds) honors -sbt-dir -# the new version of sbt-extras ignores sbt-dir, so we pass it in as -Dsbt.global.base -# need to set sbt-dir to one that has the gpg.sbt plugin config -sbtArgs="-no-colors -ivy $baseDir/ivy2 -Dsbt.override.build.repos=true -Dsbt.repository.config=$scriptsDir/repositories-scala-release -Dsbt.global.base=$HOME/.sbt/0.13 -sbt-dir $HOME/.sbt/0.13" - -sbtBuild() { - echo "### sbtBuild: "$sbtCmd $sbtArgs "${scalaVersionTasks[@]}" "${publishTasks[@]}" "$@" - $sbtCmd $sbtArgs "${scalaVersionTasks[@]}" "${publishTasks[@]}" "$@" >> $baseDir/logs/builds 2>&1 -} - -sbtResolve() { - cd $baseDir/resolutionScratch_ - touch build.sbt - cross=${4-binary} # Disabled / binary / full - echo "### sbtResolve: $sbtCmd $sbtArgs " "${scalaVersionTasks[@]}" "\"$1\" % \"$2\" % \"$3\" cross CrossVersion.$cross" - $sbtCmd $sbtArgs "${scalaVersionTasks[@]}" \ - "set libraryDependencies := Seq(\"$1\" % \"$2\" % \"$3\" cross CrossVersion.$cross)" \ - 'show update' >> $baseDir/logs/resolution 2>&1 -} - - ## BUILD STEPS: determineScalaVersion() { @@ -217,27 +95,14 @@ determineScalaVersion() { echo "Building Scala $SCALA_VER." } -deriveVersion() { - update $1 $2 $3 &> /dev/null - echo "$(git describe --match=v* | cut -dv -f2)-nightly" -} - -deriveVersionAnyTag() { - update $1 $2 $3 &> /dev/null - echo "$(git describe | cut -dv -f2)-nightly" -} - distro() { cd $WORKSPACE echo "### Building the distribution" - ant -Dextra.repo.url=$privateRepo\ - -Dmaven.version.suffix=$SCALA_VER_SUFFIX\ + ant -Dmaven.version.number=$SCALA_VER\ + -Dbuild.release=1\ -Dscaladoc.git.commit=$SCALADOC_SOURCE_LINKS_VER\ - -Dremote.snapshot.repository=NOPE\ - -Dremote.release.repository=$privateRepo\ - -Drepository.credentials.id=$privateCred\ distpack-opt (cd $WORKSPACE/dists/ && tar cvzhf ../scala-dist-$SCALA_VER.tar.gz .) -- cgit v1.2.3