Skip to content
Snippets Groups Projects
.gitlab-ci.yml 815 B
Newer Older
Gauthier HEISS's avatar
Gauthier HEISS committed
bashlint:
  stage: test
  image: python:latest
Gauthier HEISS's avatar
Gauthier HEISS committed
  before_script:
    - mkdir -p public/badges public/lint
    - echo undefined > public/badges/$CI_JOB_NAME.score
    - pip3 install anybadge
Gauthier HEISS's avatar
Gauthier HEISS committed
    - git clone https://gitlab.esiea.fr/gauthier.heiss/bash-file-scorer.git /opt/bash-file-scorer
    - apt install bc
    - apt install shellcheck
Gauthier HEISS's avatar
Gauthier HEISS committed
  script:
Gauthier HEISS's avatar
Gauthier HEISS committed
    - /opt/bash-file-scorer/score.sh | tee public/lint/lint.txt
Gauthier HEISS's avatar
Gauthier HEISS committed
    - tail -n 1 public/lint/lint.txt > public/badges/$CI_JOB_NAME.score
  after_script:
    - anybadge --overwrite --label $CI_JOB_NAME --value=$(cat public/badges/$CI_JOB_NAME.score) --file=public/badges/$CI_JOB_NAME.svg 4=red 6=orange 8=yellow 10=green
    - |
      echo "Your score is: $(cat public/badges/$CI_JOB_NAME.score)"
  artifacts:
    paths:
      - public
    when: always