Commit 332611ca20c5cab4fc591c62525d7d787584e9fc

Thomas de Grivel 2023-02-25T21:28:38

rbpkg_ci

diff --git a/bin/rbpkg_ci b/bin/rbpkg_ci
index e036052..7995771 100755
--- a/bin/rbpkg_ci
+++ b/bin/rbpkg_ci
@@ -32,6 +32,9 @@ end
 
 def rbpkg_ci
   case $ARGS[0]
+  when "--clean"
+    cmd! "rm -rf #{sh_quote(ci_dir)}"
+    shift
   when "-h"
     usage
   when "--help"
diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index 3062a2d..a0868fc 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -53,6 +53,14 @@ module Rbpkg
     "#{ci_dir}/log/#{os}/#{target}/#{date}_#{$$}"
   end
 
+  def self.ci_remote(repo, branch, commit, host)
+    verbose(3, "Rbpkg.ci_remote(#{repo.inspect}, #{branch.inspect}, #{commit.inspect}, #{host.inspect})")
+    sh_host = sh_quote(host)
+    cmd! "ssh #{sh_host} rbpkg/bin/rbpkg_ci #{sh_quote(repo)} #{sh_quote(branch)} #{sh_quote(commit)}"
+    sh_ci_dir = sh_quote(ci_dir)
+    cmd! "rsync -a #{sh_host}:#{sh_ci_dir}/. #{sh_ci_dir}"
+  end
+
   def self.ci_status_dir
     "#{ci_dir}/status/#{os}/#{target}/#{date}_#{$$}"
   end
diff --git a/lib/rbpkg/repo.rb b/lib/rbpkg/repo.rb
index 0c5f163..e67395e 100644
--- a/lib/rbpkg/repo.rb
+++ b/lib/rbpkg/repo.rb
@@ -55,7 +55,7 @@ class Rbpkg::Repo
       end
     end
     Rbpkg::Log.add("rbpkg_ci.#{name}.install")
-    cmd! "rbpkg_bootstrap -f #{sh_quote(ci_dir)}"
+    cmd! "#{sh_quote(Rbpkg.dir)}/rbpkg_bootstrap -f #{sh_quote(ci_dir)}"
     cmd! "export RBPKG_DIR=#{sh_ci_dir} && . #{sh_ci_profile} && rbpkg clone #{sh_name} && rbpkg checkout #{sh_quote(commit)} #{sh_name} && rbpkg install #{sh_name}"
     Rbpkg::Log.ok("rbpkg_ci.#{name}.install")
     Rbpkg::Log.ok(ci_log_name_commit(commit))
diff --git a/rbpkg.gemspec b/rbpkg.gemspec
index d511a02..fb05bdb 100644
--- a/rbpkg.gemspec
+++ b/rbpkg.gemspec
@@ -1,7 +1,6 @@
 Gem::Specification.new do |s|
   s.name        = "rbpkg"
   s.version     = "0.1.0"
-  s.summary     = "Hola!"
   s.description = "Ruby package manager"
   s.authors     = ["Thomas de Grivel"]
   s.email       = "thodg@kmx.io"