stages:
  - gitsync
  - Создание тестовой базы
  - Синтаксический контроль
  - Тесты
  - vanessa
  - АПК
  - SonarQube
  - Allure

gitsync:
  stage: gitsync
  variables:
    GITSYNC_V8VERSION: 8.3.18.1483
  only:
    - schedules
  tags:
    - OneS
  script:
    - gitsync sync -u ci-bot -p 12345678 C:\DevOps\storage src\cf
    - git push http://ci-bot:12345678@example.com/vsokolov/devops.git/ HEAD:develop

Создание тестовой базы:
  stage: Создание тестовой базы
  except:
    - schedules
  only:
    refs:
      - develop
  tags:
    - OneS
  script:
    - vrunner init-dev --dt C:\DevOps\course.dt --db-user Администратор --src src/cf

Синтаксический контроль:
  stage: Синтаксический контроль
  except:
    - schedules
  variables:
    GIT_STRATEGY: none
  allow_failure: true
  only:
    refs:
      - develop
  tags:
    - OneS
  script:
    - vrunner syntax-check
  artifacts:
    reports:
      junit:
        build/syntax-check/junit/junit.xml

Дымовые тесты:
  stage: Тесты
  except:
    - schedules
  variables:
    GIT_STRATEGY: none
  allow_failure: true
  only:
    refs:
      - develop
  tags:
    - OneS
  script:
    - vrunner xunit
  artifacts:
    reports:
      junit:
        build/smoke/junit/*.xml

Модульные тесты:
  stage: Тесты
  except:
    - schedules
  variables:
    GIT_STRATEGY: none
  allow_failure: true
  only:
    refs:
      - develop
  tags:
    - OneS
  script:
    - vrunner compileepf tests tests
    - vrunner xunit --settings ./env-tests.json
  artifacts:
    reports:
      junit:
        build/tests/junit/*.xml

vanessa:
  stage: vanessa
  except:
    - schedules
  variables:
    GIT_STRATEGY: none
  allow_failure: true
  only:
    refs:
      - develop
  tags:
    - OneS
  script:
    - vrunner vanessa
  artifacts:
    reports:
      junit:
        build/vanessa/junit/*.xml

АПК:
  stage: АПК
  except:
    - schedules
  variables:
    GIT_STRATEGY: none
  allow_failure: true
  only:
    refs:
      - develop
  tags:
    - OneS
  script:
    - vrunner run --ibconnection /FC:/DevOps/ACC --db-user="" --db-pwd=""  --command "acc.catalog=$env:CI_PROJECT_DIR;acc.propertiesPaths=./tools/acc-export/acc.properties;" --execute "./tools/acc-export/acc-export.epf" --ordinaryapp 1

SonarQube:
  stage: SonarQube
  except:
    - schedules
  variables:
    GIT_STRATEGY: none
  allow_failure: true
  only:
    refs:
      - develop
  tags:
    - OneS
  script:
    - sonar-scanner -D sonar.login=80aeb2585cacfde187ada1e5a14acf3e8ae1d651 -D sonar.projectVersion=$env:CI_BUILD_ID

Allure:
  stage: Allure
  except:
    - schedules
  variables:
    GIT_STRATEGY: none
  allow_failure: true
  only:
    refs:
      - develop
  tags:
    - OneS
  script:
    - allure generate build/syntax-check/allure build/smoke/allure build/vanessa/allure build/tests/allure -c -o build/allure-result
  artifacts:
    paths:
      - build/allure-result

# stages:
#   - ping1
#   - ping2


# ping:
#   stage: ping1
#   only:
#     refs:
#       - develop
#   tags:
#     - OneS
#   script:
#     - ping 8.8.8.8

# ping2:
#   stage: ping2
#   only:
#     refs:
#       - main
#   tags:
#     - OneS
#   script:
#     - ping 8.8.8.8