Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package openSUSE-release-tools for 
openSUSE:Factory checked in at 2021-10-23 00:51:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openSUSE-release-tools (Old)
 and      /work/SRC/openSUSE:Factory/.openSUSE-release-tools.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openSUSE-release-tools"

Sat Oct 23 00:51:47 2021 rev:338 rq:927013 version:20211022.c7c2beb4

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/openSUSE-release-tools/openSUSE-release-tools.changes
    2021-10-12 21:51:04.968020271 +0200
+++ 
/work/SRC/openSUSE:Factory/.openSUSE-release-tools.new.1890/openSUSE-release-tools.changes
  2021-10-23 00:52:33.109163103 +0200
@@ -1,0 +2,7 @@
+Fri Oct 22 15:35:02 UTC 2021 - opensuse-releaset...@opensuse.org
+
+- Update to version 20211022.c7c2beb4:
+  * Adjust secret_config_id in the dashboard.generator pipeline
+  * Add pipeline to publish the vagrant boxes to Vagrant Cloud
+
+-------------------------------------------------------------------

Old:
----
  openSUSE-release-tools-20211012.2f5f796d.obscpio

New:
----
  openSUSE-release-tools-20211022.c7c2beb4.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ openSUSE-release-tools.spec ++++++
--- /var/tmp/diff_new_pack.Kvwj9U/_old  2021-10-23 00:52:33.757163389 +0200
+++ /var/tmp/diff_new_pack.Kvwj9U/_new  2021-10-23 00:52:33.761163391 +0200
@@ -20,7 +20,7 @@
 %define source_dir openSUSE-release-tools
 %define announcer_filename factory-package-news
 Name:           openSUSE-release-tools
-Version:        20211012.2f5f796d
+Version:        20211022.c7c2beb4
 Release:        0
 Summary:        Tools to aid in staging and release work for openSUSE/SUSE
 License:        GPL-2.0-or-later AND MIT

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.Kvwj9U/_old  2021-10-23 00:52:33.793163406 +0200
+++ /var/tmp/diff_new_pack.Kvwj9U/_new  2021-10-23 00:52:33.793163406 +0200
@@ -1,6 +1,6 @@
 <servicedata>
   <service name="tar_scm">
     <param 
name="url">https://github.com/openSUSE/openSUSE-release-tools.git</param>
-    <param 
name="changesrevision">2bd4ea9fd1a4c3ddbec27e9138ab3169e0e78ed9</param>
+    <param 
name="changesrevision">c7c2beb46b5f55193ed62d894522d393acaa0f0e</param>
   </service>
 </servicedata>

++++++ openSUSE-release-tools-20211012.2f5f796d.obscpio -> 
openSUSE-release-tools-20211022.c7c2beb4.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20211012.2f5f796d/gocd/dashboard.generator.gocd.yaml 
new/openSUSE-release-tools-20211022.c7c2beb4/gocd/dashboard.generator.gocd.yaml
--- 
old/openSUSE-release-tools-20211012.2f5f796d/gocd/dashboard.generator.gocd.yaml 
    2021-10-12 11:27:26.000000000 +0200
+++ 
new/openSUSE-release-tools-20211022.c7c2beb4/gocd/dashboard.generator.gocd.yaml 
    2021-10-22 17:33:50.000000000 +0200
@@ -5,7 +5,7 @@
     lock_behavior: unlockWhenFinished
     environment_variables:
       OSC_CONFIG: /home/go/config/oscrc-totest-manager
-      RSYNC_PASSWORD: '{{SECRET:[RSYNC_FOR_COOLO][RSYNC_FOR_COOLO]}}'
+      RSYNC_PASSWORD: '{{SECRET:[opensuse.secrets][RSYNC_FOR_COOLO]}}'
     materials:
       script:
         git: https://github.com/openSUSE/openSUSE-release-tools.git
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20211012.2f5f796d/gocd/vagrant-publisher.gocd.yaml 
new/openSUSE-release-tools-20211022.c7c2beb4/gocd/vagrant-publisher.gocd.yaml
--- 
old/openSUSE-release-tools-20211012.2f5f796d/gocd/vagrant-publisher.gocd.yaml   
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/openSUSE-release-tools-20211022.c7c2beb4/gocd/vagrant-publisher.gocd.yaml   
    2021-10-22 17:33:50.000000000 +0200
@@ -0,0 +1,22 @@
+format_version: 3
+pipelines:
+  openSUSE.Vagrant.Publish:
+    group: openSUSE.Checkers
+    lock_behavior: unlockWhenFinished
+    environment_variables:
+      ATLAS_TOKEN: '{{SECRET:[opensuse.secrets][ATLAS_TOKEN]}}'
+    materials:
+      git:
+        git: https://github.com/openSUSE/opensuse-release-tools.git
+    timer:
+      spec: 0 0 0 ? * *
+      only_on_changes: false
+    stages:
+    - Run:
+        approval: manual
+        resources:
+        - obs-to-vagrantcloud
+        tasks:
+        - script: |
+            ruby.ruby3.0 obs-to-vagrantcloud.rb --url 
https://download.opensuse.org/tumbleweed/appliances/boxes/Tumbleweed.x86_64.json
 --organization opensuse --new-box-name Tumbleweed.x86_64 --provider libvirt
+            ruby.ruby3.0 obs-to-vagrantcloud.rb --url 
https://download.opensuse.org/tumbleweed/appliances/boxes/Tumbleweed.x86_64.json
 --organization opensuse --new-box-name Tumbleweed.x86_64 --provider virtualbox
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20211012.2f5f796d/obs-to-vagrantcloud.rb 
new/openSUSE-release-tools-20211022.c7c2beb4/obs-to-vagrantcloud.rb
--- old/openSUSE-release-tools-20211012.2f5f796d/obs-to-vagrantcloud.rb 
1970-01-01 01:00:00.000000000 +0100
+++ new/openSUSE-release-tools-20211022.c7c2beb4/obs-to-vagrantcloud.rb 
2021-10-22 17:33:50.000000000 +0200
@@ -0,0 +1,143 @@
+# frozen_string_literal: true
+
+require 'vagrant_cloud'
+require 'down/net_http'
+require 'http'
+require 'optparse'
+require 'optparse/uri'
+require 'open-uri'
+require 'fileutils'
+
+def ensure_box_present(box_from_obs, org)
+  matching_boxes = org.boxes.select { |b| b.name == box_from_obs['name'] }
+  matching_box = nil
+
+  if matching_boxes.empty?
+    matching_box = org.add_box(box_from_obs['name'])
+    matching_box.private = false
+    matching_box.description = box_from_obs['description']
+    matching_box.short_description = box_from_obs['short_description']
+  elsif matching_boxes.length > 1
+    raise "Got #{matching_boxes.length} matching boxes, but should have gotten 
at most one"
+  else
+    matching_box = matching_boxes[0]
+  end
+
+  matching_box
+end
+
+def link_box(box_from_obs, org)
+  matching_box = ensure_box_present(box_from_obs, org)
+  matching_box.versions.each(&:delete)
+
+  matching_box.versions = []
+  matching_box.save
+
+  box_from_obs['versions'].each do |version|
+    ver = matching_box.add_version(version['version'])
+    ver.description = version['description']
+
+    version['providers'].each do |provider|
+      prov = ver.add_provider(provider['name'])
+      prov.url = provider['url']
+    end
+
+    ver.save
+    ver.release
+  end
+  matching_box.save
+
+  matching_box
+end
+
+##
+# Uploads the box specified in the hash box_from_obs to VagrantCloud using the
+# supplied organization.
+def upload_non_existent_boxes(box_from_obs, organization, provider_to_upload)
+  matching_box = ensure_box_present(box_from_obs, organization)
+
+  box_from_obs['versions'].each do |version|
+    matching_versions = matching_box.versions.select { |v| v.version == 
version['version'] }
+    matching_version = nil
+
+    if matching_versions.length == 1
+      matching_version = matching_versions[0]
+    elsif matching_versions.empty?
+      matching_box.save
+      matching_version = matching_box.add_version(version['version'])
+      matching_version.description = version['description']
+    else
+      raise "Got #{matching_versions.length} matching versions, but should 
have gotten one or none"
+    end
+
+    provider_added = false
+
+    not_present_providers = version['providers'].select do |prov_from_obs|
+      matching_version.providers.select { |p| p.name == prov_from_obs['name'] 
}.empty?
+    end
+    unless provider_to_upload.nil?
+      not_present_providers = not_present_providers.select { |p| p['name'] == 
provider_to_upload }
+    end
+
+    not_present_providers.each do |provider|
+      prov = matching_version.add_provider(provider['name'])
+      begin
+        box_dest = Down::NetHttp.download(provider['url'], max_redirects: 20)
+        matching_box.save
+        prov.upload(path: box_dest.path)
+        provider_added = true
+      ensure
+        box_dest.close
+        box_dest.unlink
+      end
+    end
+
+    matching_version.release if provider_added && !matching_version.released?
+  end
+  matching_box
+end
+
+env_var = 'ATLAS_TOKEN'
+
+raise "Environment variable #{env_var} is required" if ENV[env_var].nil?
+
+options = {}
+OptionParser.new do |opts|
+  opts.on('--url URI', 'URL to json file published on OBS') do |u|
+    options[:url] = u
+  end
+
+  opts.on('--organization ORG', 'organization/publisher of the vagrant box') 
do |p|
+    options[:publisher] = p
+  end
+
+  opts.on('-n NAME', '--new-box-name NAME', 'alternative name for the Vagrant 
box') do |n|
+    options[:name] = n
+  end
+
+  opts.on('-p PROVIDER', '--provider PROVIDER', 'only upload the supplied 
provider (unsupported for linking!)') do |p|
+    options[:provider] = p
+  end
+
+  opts.on('-l', '--link', 'just link the box to from OBS and don\'t upload 
it') do
+    options[:link] = true
+  end
+end.parse!
+
+raise 'An organization must be provided' if options[:publisher].nil?
+
+options[:link] = false if options[:link].nil?
+raise 'Linking only a single provider is not supported' if options[:link] && 
!options[:provider].nil?
+
+box_json = JSON.parse(HTTP.get(options[:url]))
+
+account = VagrantCloud::Account.new(access_token: ENV[env_var])
+publisher = account.organization(name: options[:publisher])
+
+box_json['name'] = options[:name] unless options[:name].nil?
+
+if options[:link]
+  link_box(box_json, publisher)
+else
+  upload_non_existent_boxes(box_json, publisher, options[:provider])
+end

++++++ openSUSE-release-tools.obsinfo ++++++
--- /var/tmp/diff_new_pack.Kvwj9U/_old  2021-10-23 00:52:34.341163648 +0200
+++ /var/tmp/diff_new_pack.Kvwj9U/_new  2021-10-23 00:52:34.341163648 +0200
@@ -1,5 +1,5 @@
 name: openSUSE-release-tools
-version: 20211012.2f5f796d
-mtime: 1634030846
-commit: 2f5f796de3895d3adf75694e7efa953f8083b4e7
+version: 20211022.c7c2beb4
+mtime: 1634916830
+commit: c7c2beb46b5f55193ed62d894522d393acaa0f0e
 

Reply via email to