format_version: 3
pipelines:
  Pkglistgen.openSUSE_Factory:
    group: Factory
    lock_behavior: unlockWhenFinished
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-staging-bot
    timer:
      spec: 0 40 * ? * *
      only_on_changes: false
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - pkglistgen:
        approval:
          type: manual
        jobs:
<% ['openSUSE:Factory/target', 'openSUSE:Factory/ring1', 'openSUSE:Factory:ARM/target', 'openSUSE:Factory:ARM/ring1', 'openSUSE:Factory:LegacyX86/target', 'openSUSE:Factory:PowerPC', 'openSUSE:Factory:zSystems', 'openSUSE:Factory:RISCV'].each do |project|
  project=project.split('/')
  name=project[0].gsub(':', '_')
  if project.size > 1
    options=" -s #{project[1]}"
    name = name + "_#{project[1]}"
  else
    options=" -s target"
  end
  -%>
          <%= name %>:
            resources:
            - repo-checker
            tasks:
              - script: |
                  python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p <%= project[0] %><%= options %> --only-release-packages --force
                  python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p <%= project[0] %><%= options %>
<% end -%>
  Update.Repos.Factory:
    group: Factory
    lock_behavior: unlockWhenFinished
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-staging-bot
    timer:
      spec: 0 0 21 ? * *
      only_on_changes: false
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Update:
        approval:
          type: manual
        jobs:
<% %w(openSUSE:Factory openSUSE:Factory:ARM openSUSE:Factory:PowerPC openSUSE:Factory:RISCV).each do |project| -%>
          <%= project.gsub(':', '_') %>:
            resources:
            - repo-checker
            tasks:
              - script: python3 -u ./pkglistgen.py --apiurl https://api.opensuse.org handle_update_repos <%= project %>
<% end -%>
  Update.Repos.Leap_16_0:
    group: Leap
    lock_behavior: unlockWhenFinished
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-staging-bot
    timer:
      spec: 0 0 21 ? * *
      only_on_changes: false
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Update:
        approval:
          type: manual
        jobs:
<% %w(openSUSE:Leap:16.0).each do |project| -%>
          <%= project.gsub(':', '_') %>:
            resources:
            - repo-checker
            tasks:
              - script: python3 -u ./pkglistgen.py --apiurl https://api.opensuse.org handle_update_repos <%= project %>
<% end -%>
  Update.Weakremovers.Leap_16_0:
    group: Leap
    lock_behavior: unlockWhenFinished
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-staging-bot
    timer:
      spec: 0 0 0/4 ? * *
      only_on_changes: false
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Update:
        approval:
          type: manual
        jobs:
<% %w(openSUSE:Leap:16.0).each do |project| -%>
          <%= project.gsub(':', '_') %>:
            resources:
            - repo-checker
            tasks:
              - script: python3 -u ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p <%= project %> -s target --only-update-weakremovers
<% end -%>
  SkippkgFinder.Leap_16_0:
    group: Leap
    lock_behavior: unlockWhenFinished
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-staging-bot
    timer:
      spec: 0 40 * ? * *
      only_on_changes: false
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Update:
        approval:
          type: manual
        jobs:
<% %w(openSUSE:Leap:16.0).each do |project| -%>
          <%= project.gsub(':', '_') %>:
            resources:
            - repo-checker
            tasks:
              - script: python3 ./skippkg-finder.py -A https://api.opensuse.org -o <%= project %>
<% end -%>
  OfflineInstaller.PackageLists.Leap_16_0:
    group: Leap
    lock_behavior: unlockWhenFinished
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-staging-bot
    timer:
      spec: 0 40 * ? * *
      only_on_changes: false
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Update.000productcompose.dvd:
        resources:
        - repo-checker
        tasks:
          - script: ./pkglistgen.py --verbose -A https://api.opensuse.org update_and_solve --project openSUSE:Leap:16.0 --scope target --engine product_composer --force
