---
- job:
    name: jjb-deploy
    project-type: pipeline
    concurrent: false
    parameters:
      - string:
          name: GIT_REPO
          default: https://github.com/noobaa/noobaa-core
          description: The git repo url
      - string:
          name: GIT_BRANCH
          default: master
          description: The git branch
    properties:
      - github:
          url: $GIT_REPO
      - build-discarder:
          days-to-keep: 7
          artifact-days-to-keep: 7
    dsl: |
      node {
        stage('checkout ci repository') {
          git url: "${GIT_REPO}", branch: "${GIT_BRANCH}", changelog: false
        }
        stage('deployment') {
          sh "./.jenkins/deploy/jjb.sh --cmd deploy --GIT_REF ${GIT_BRANCH} --GIT_REPO ${GIT_REPO}"
        }
      }
    scm:
      - git:
          name: origin
          url: $GIT_REPO
          branches:
            - $GIT_BRANCH
    triggers:
      - pollscm:
          cron: "H/5 * * * *"
