kind: pipeline
type: docker
name: amd-64

platform:
  arch: amd64

trigger:
  event:
    - push

steps:
- name: build
  image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-drone-cppcheck:latest
  volumes:
    - name: work
      path: /work
  commands:
    - find . -iname "*.cpp" | xargs cppcheck -v --enable=all --xml-version=2 --xml 2> /work/cppcheck.xml
    - cd Sources/_Linux/
    - make -f makefile.lnx release

- name: code analysis
  image: aosapps/drone-sonar-plugin
  volumes:
    - name: work
      path: /work
  settings:
      sonar_host: hub.codefirst.iut.uca.fr/sonar/
      sonar_token: 96864ed9ef8d6343007881fc9ef30eb70eaf846d
      java_binaries: target/classes
      level: DEBUG
      sources: .
  depends_on: [ build ]

- name: generate-and-deploy-docs
  image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
  volumes:
    - name: docs
      path: /docs
  commands:
    - cd Documentation/doxygen
    - doxygen Doxyfile
    - /entrypoint.sh
  when:
    branch:
      - master
  depends_on: [ build ]

# image_pull_secrets:
#  - DOCKERCONFIG
  
volumes:
- name: work
  temp: {}