specs/repositories.rbspec
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 24 Aug 2017 00:15:51 +0100
branchstx-8.0.0
changeset 171 2662903f1dfd
parent 170 c0383fb4e51f
child 234 05943c900d5e
permissions -rw-r--r--
Rakefiles: auto-configure repository set ...based on URL from where the rakefiles were cloned. This makes CI setup easier (no need for REPOSITORYSET variable) and also makes it easier for developers to build from (their) staging repositories rather than from the canonical).

# This file defines a set of repositories to fetch source code from.
#

begin
  #
  # All packages that are not (yet) forked are taken from
  # eXept's public CVS repository
  #
  repository :'exept:public' do
    type :cvs
    canonical ":pserver:cvs@cvs.smalltalk-x.de:/cvs/stx"
  end

  #
  # Autp-configure jv-branch:public and jv-branch:private
  # repositories based on the URL of rakefiles.
  #
  origin_forest_url = HG::Repository.new(BUILD_DIR / '..').paths['default'].slice(0.. - 'stx-goodies-builder-rake'.size - 2)
  cloned_from_bitbucket = origin_forest_url =~ /bitbucket.org/
  cloned_from_swing     = origin_forest_url =~ /swing\.fit\.cvut\.cz/
  cloned_fron_devsrepo  = (not cloned_from_bitbucket) and (not cloned_from_swing)


  repository :'jv-branch:public' do
    type :hg
    separator '-'
    canonical "https://bitbucket.org/janvrany"

    case
    when cloned_from_swing
      staging   "ssh://hg@swing.fit.cvut.cz//var/local/hg"
    when cloned_fron_devsrepo
      upstream  "ssh://hg@swing.fit.cvut.cz//var/local/hg"
      staging   origin_forest_url
    end
   end

  # Only core developer and/or Jenkins have access to
  # stx:stc and stx:librun...
  if (core_developer? or jenkins?)
  repository :'jv-branch:private' do
    type :hg
    separator '-'
    case
    when cloned_fron_devsrepo
      canonical origin_forest_url
    else
      canonical "ssh://192.168.12.2//hg"
    end
  end
  end
end