[SCM] ci-tooling packaging branch, master, updated. 1b6cb1e14da0861650639318d9d1accfcbbeb7aa

Harald Sitter apachelogger-guest at moszumanska.debian.org
Thu Jan 14 08:27:51 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=da440fc

The following commit has been merged in the master branch:
commit da440fc3a8036d5e81042d713b07e33fb186f47e
Author: Harald Sitter <sitter at kde.org>
Date:   Wed Jan 13 10:18:09 2016 +0100

    refactor away from a shit if to a slightly less shitty case when
---
 lib/projects.rb | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/lib/projects.rb b/lib/projects.rb
index e9397cf..358bfb4 100644
--- a/lib/projects.rb
+++ b/lib/projects.rb
@@ -235,19 +235,24 @@ class ProjectFactory
           fail "Unknown type #{custom_ci['type']}"
         end
         repos = []
-        if custom_ci['type'] == 'github'
-          require 'octokit'
-          custom_ci['git_host'] = 'https://github.com/'
+        case custom_ci['type']
+        when 'github'
           if custom_ci['repos'] == ['all']
-            Octokit.organization_repositories(custom_ci['org']).each do |octo_repo|
-              repos << octo_repo[:name]
-            end
+            repos = `ssh #{custom_ci['git_host']} ls /`.chop!.gsub!('.git', '')
+            repos = repos.split(' ')
           else
-            repos = custom_ci['repos']
+            require 'octokit'
+            custom_ci['git_host'] = 'https://github.com/'
+            if custom_ci['repos'] == ['all']
+              octo_repos = Octokit.organization_repositories(custom_ci['org'])
+              octo_repos.each do |octo_repo|
+                repos << octo_repo[:name]
+              end
+            else
+              repos = custom_ci['repos']
+            end
           end
-        elsif custom_ci['repos'] == ['all'] && custom_ci['type'] != 'github'
-          repos = `ssh #{custom_ci['git_host']} ls /`.chop!.gsub!('.git', '').split(' ')
-        elsif custom_ci['type'] == 'neon'
+        when 'neon'
           custom_ci['git_host'] = 'git://packaging.neon.kde.org.uk'
           repos = custom_ci['repos']
         else

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list