Rakefiles: refactor access to stc and librun
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 25 Jul 2019 11:16:15 +0100
changeset 273 70c505f690bf
parent 272 13ce86e80c30
child 274 d9d5871b987c
Rakefiles: refactor access to stc and librun Instead of detecting whether a user has access to stc and librun upfront, try to check it out and download binary packages if checkout fails. This simplifies the setup of private CI builds a little.
specs/repositories.rbspec
specs/stx-jv.rbspec
--- a/specs/repositories.rbspec	Thu Jul 25 11:00:12 2019 +0100
+++ b/specs/repositories.rbspec	Thu Jul 25 11:16:15 2019 +0100
@@ -29,17 +29,6 @@
     origin origin_forest_url
   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 '-'
-      if ((not cloned_from_bitbucket) and (not cloned_from_swing))
-        origin origin_forest_url
-      end
-    end
-  end
 rescue Exception
   info "Building from source archive"
 end
--- a/specs/stx-jv.rbspec	Thu Jul 25 11:00:12 2019 +0100
+++ b/specs/stx-jv.rbspec	Thu Jul 25 11:16:15 2019 +0100
@@ -63,12 +63,12 @@
   import :'stx:baseline'
 
   # FORKED STC and librun
-  package "stx:stc", :repository => :'jv-branch:private', :branch => 'jv',
+  package "stx:stc", :repository => :'jv-branch:public', :branch => 'jv',
     :checkout => (Proc.new do | pkg |
       # Download pre-compiled binary if user has no access to source code
-      if Rake::Stx::Configuration::Repository::find(pkg.repository) then
+      begin
         checkout pkg.repository, 'stx/stc', :branch => pkg.branch, :revision => pkg.revision
-      else
+      rescue Exception
         download_binary_component('stc', BUILD_DIR / 'stx')
       end
     end),
@@ -77,15 +77,15 @@
         update pkg.repository, 'stx/stc', :branch => pkg.branch, :revision => pkg.revision
       elsif not jenkins?
         download_binary_component('stc', BUILD_DIR / 'stx')
-    end
-  end)
+      end
+    end)
 
-  package "stx:librun", :repository => :'jv-branch:private', :branch => 'jv',
+  package "stx:librun", :repository => :'jv-branch:public', :branch => 'jv',
     :checkout => (Proc.new do | pkg |
       # Download pre-compiled binary if user has no access to source code
-      if Rake::Stx::Configuration::Repository::find(pkg.repository) then
+      begin
         checkout pkg.repository, 'stx/librun', :branch => pkg.branch, :revision => pkg.revision
-      else
+      rescue Exception
         download_binary_component('librun', BUILD_DIR / 'stx')
       end
     end),
@@ -94,8 +94,8 @@
         update pkg.repository, 'stx/stc', :branch => pkg.branch, :revision => pkg.revision
       elsif not jenkins?
         download_binary_component('librun', BUILD_DIR / 'stx')
-    end
-  end)
+      end
+    end)
 
   # FORKED libraries
   # ======================================================================