- job:
    name: storyboard-tox-sqlite
    parent: openstack-tox
    description: |
      Run tests using sqlite instead of mysql.
    vars:
      tox_envlist: sqlite

- secret:
    name: storyboard-opendev-dockerhub
    data:
      username: opendevzuul
      password: !encrypted/pkcs1-oaep
        - BjUCfa2WGM0qlQStkP0TGIdlTr/ChlgRhyYv5W4xswnpju/NPZ4ARa7ThsoQzLBFG58Wr
          hK/eEImMEpQzqcbFjhBCbGIdsvgM8ufD+piUOhKG56exYtBcyXaR48ZTHX3RHI+bbFHcV
          TO7KmDiVbA8CbqUZpn54T523RBlbOfjPYCcoAuodL5RnKXShCCeyxZ4kXM0eTRTDaCivJ
          kBkioHjqOrm/nY7fxIrRaBu1RsUr00837Ievx/9Np66YjviScaDv6AlOTaa6K7ja1yaVC
          smxJtHtckY+5kP5ZRAsYuwh/rtfit7gOQn43cpKrrGY5YCjejTRMbOUtvl0ZWYhaPCG0o
          dsaNZRWPHA18w1cnrCedfVB1F/KNvxEAmQTYCtbLtwSQCvA791Wy4aQjmXysK3fFXW0Jv
          JN5ephA2skg2DaGXx1XY0tq6pWDwxCee0gbNGAVy89FHimOtjFrFDptPVgpWQfkpQ2NWt
          vXzPRqw4qwhF+mAf+cc98I0mi4sQcaVVf7lRlS3zw7AXtia6I0m/NV3AuaUd1kEay94Q/
          BTP2xl/6Zfcu0vWp3AZDwSi/RdHnlYGOH6BGAQEIiY6ygzkIU6IzSaochiQQnCfa3/7Ao
          EzNVWsEXmm/COgtK3LsI7omHo7xApGaf0DYif8BG0GeoOzPPE6gcLNGkOnmtqA=

- job:
    name: storyboard-build-opendev-image
    parent: opendev-build-docker-image
    dependencies: opendev-buildset-registry
    description: Build OpenDev Docker images for storyboard
    requires:
      - python-base-3.9-bullseye-container-image
      - python-builder-3.9-bullseye-container-image
    provides: storyboard-container-image
    vars: &storyboard_opendev_image_vars
      zuul_work_dir: src/opendev.org/opendev/storyboard
      docker_images:
        - context: .
          repository: opendevorg/storyboard
          target: storyboard
        - context: .
          repository: opendevorg/storyboard-api
          target: storyboard-api
        - context: .
          repository: opendevorg/storyboard-subscriber
          target: storyboard-subscriber
        - context: .
          repository: opendevorg/storyboard-worker-daemon
          target: storyboard-worker-daemon
        - context: .
          repository: opendevorg/storyboard-db-manage
          target: storyboard-db-manage
        - context: .
          repository: opendevorg/storyboard-migrate
          target: storyboard-migrate
        - context: .
          repository: opendevorg/storyboard-cron
          target: storyboard-cron

- job:
    name: storyboard-upload-opendev-image
    parent: opendev-upload-docker-image
    description: Build OpenDev storyboard Docker images and upload to Docker Hub.
    requires:
      - python-base-3.9-bullseye-container-image
      - python-builder-3.9-bullseye-container-image
    provides: storyboard-container-image
    vars: *storyboard_opendev_image_vars
    secrets:
      - name: docker_credentials
        secret: storyboard-opendev-dockerhub
        pass-to-parent: true

- job:
    name: storyboard-promote-opendev-image
    parent: opendev-promote-docker-image
    description: Promote previously uploaded storyboard Docker images.
    vars: *storyboard_opendev_image_vars
    secrets:
      - name: docker_credentials
        secret: storyboard-opendev-dockerhub
        pass-to-parent: true

- project:
    check:
      jobs:
        - tox-cover:
            timeout: 6000
        - storyboard-tox-sqlite
        - tox-pep8
        - tox-py36:
            timeout: 6000
            nodeset: ubuntu-bionic
        - tox-py37:
            timeout: 6000
            nodeset: ubuntu-bionic
        - tox-py38:
            timeout: 6000
        - opendev-buildset-registry
        - storyboard-build-opendev-image
    gate:
      jobs:
        - storyboard-tox-sqlite
        - tox-pep8
        - tox-py36:
            timeout: 6000
            nodeset: ubuntu-bionic
        - tox-py37:
            timeout: 6000
            nodeset: ubuntu-bionic
        - tox-py38:
            timeout: 6000
        - opendev-buildset-registry
        - storyboard-upload-opendev-image
    post:
      jobs:
        - publish-openstack-python-branch-tarball
    promote:
      jobs:
        - storyboard-promote-opendev-image
