format_version: 3
pipelines:
  openSUSE.Source.Check:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    timer:
      spec: 0 */5 * ? * *
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-factory-auto
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Run:
        approval:
          type: manual
        jobs:
          Run:
            resources:
            - staging-bot
            tasks:
            - script: ./check_source.py -A https://api.opensuse.org --verbose --skip-add-reviews --user factory-auto review
  openSUSE.MaintInstCheck:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    timer:
      spec: 0 0 * ? * *
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-maintenance-installcheck
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Run:
        approval:
          type: manual
        jobs:
          Run:
            resources:
            - repo-checker
            tasks:
            - script: ./maintenance-installcheck.py -A https://api.opensuse.org --user=maintenance-installcheck --debug review
  openSUSE.Legal.Check:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    timer:
      spec: 0 */5 * ? * *
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-legal-auto
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Run:
        approval:
          type: manual
        jobs:
          Run:
            resources:
            - staging-bot
            tasks:
            - script: ./legal-auto.py -A https://api.opensuse.org --debug --legaldb https://legaldb.suse.de --group=legal-auto review
            - script: ./legal-auto.py -A https://api.opensuse.org --debug --legaldb https://legaldb.suse.de --user=licensedigger review
  openSUSE.Legal.Import:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    timer:
      spec: 0 0 */3 ? * *
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-legal-auto
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Run:
        approval:
          type: manual
        jobs:
          Run:
            resources:
            - staging-bot
            tasks:
            - script: ./legal-auto.py -A https://api.opensuse.org --debug --legaldb https://legaldb.suse.de project $(cat /home/go/config/legal-auto-projects-opensuse)
  openSUSE.Maintenance:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    timer:
      spec: 0 */30 * ? * *
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-maintbot
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Run:
        approval:
          type: manual
        jobs:
          Run:
            resources:
            - staging-bot
            tasks:
            - script: ./check_maintenance_incidents.py --verbose review
  Factory.Staging.Report:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    timer:
     spec: 0 */3 * ? * *
    environment_variables:
     OSC_CONFIG: /home/go/config/oscrc-staging-bot
    materials:
     git:
       git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Run:
       approval:
         type: manual
       jobs:
         Run:
           resources:
           - staging-bot
           tasks:
           - script: ./staging-report.py --debug -A https://api.opensuse.org -p openSUSE:Factory
  OS.Origin.Manager:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-origin-manager
    materials:
      script:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    timer:
      spec: 0 */5 * ? * *
      only_on_changes: false
    stages:
    - Run:
        approval: manual
        resources:
          - staging-bot
        tasks:
          - script: ./origin-manager.py -A https://api.opensuse.org --debug review
  OS.Origin.Manager.Update:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-origin-manager
    materials:
      script:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    timer:
      spec: 0 0 7 ? * *
      only_on_changes: false
    stages:
    - Run:
        approval: manual
        resources:
          - staging-bot
        tasks:
          - script: |-
              tempdir=$(mktemp -d)
              mkdir -p $tempdir/.osc-plugins
              ln -s $PWD/osc-origin.py $tempdir/.osc-plugins
              ln -s $PWD/osclib $tempdir/.osc-plugins
              HOME=$tempdir osc -A https://api.opensuse.org origin update
              rm -rf $tempdir
  openSUSE.QA.Maint:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-openqa-maintenance
    materials:
      script:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    timer:
      spec: 0 */10 * ? * *
      only_on_changes: false
    stages:
    - Run:
        approval: manual
        resources:
          - staging-bot
        tasks:
          - script: |-
             ./openqa-maintenance.py --group qam-openqa --review-mode=accept-onpass --debug --openqa https://openqa.opensuse.org  --apiurl https://api.opensuse.org review
  openSUSE.Devel.Reminder:
    group: openSUSE.Checkers
    lock_behavior: unlockWhenFinished
    timer:
      spec: 0 0 15 ? * *
    environment_variables:
      OSC_CONFIG: /home/go/config/oscrc-staging-bot
    materials:
      git:
        git: https://github.com/openSUSE/openSUSE-release-tools.git
    stages:
    - Run:
        approval:
          type: manual
        resources:
        - staging-bot
        tasks:
        - script: ./devel-project.py reviews --min-age 3 --remind
        - script: ./devel-project.py requests --min-age 3 --remind

