Commit c0cf45ba authored by Thomas Boni's avatar Thomas Boni
Browse files

Merge branch 'latest' into 'latest'

Make a new job [twig_lint]

See merge request r2devops/hub!182
parents d6a4beb1 4b55236d
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
## Objective

This job check if there are any errors on the twig templates

## How to use it

1. Put your twig files in the directory "templates"
2. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting
   started](/use-the-hub)). Example:
    ```yaml
    include:
      - remote: 'https://jobs.r2devops.io/twig_lint.yml'
    ```
3. If you need to customize the job (stage, variables, ...) 👉 check the [jobs
   customization](/use-the-hub/#jobs-customization)
4. Well done, your job is ready to work ! 😀

## Job details

* Job name: `twig_lint`
* Docker image:
[`twig_lint`](https://hub.docker.com/r/jakzal/phpqa/)
* Default stage: `static_tests`
* When: `always`

### Variables

| Name | Description | Default |
| ---- | ----------- | ------- |
| `TEMPLATE_PATH` <img width=100/> | A general variable for this job <img width=175/>| `./templates` <img width=100/>|

jobs/twig_lint/job.yml

0 → 100644
+14 −0
Original line number Diff line number Diff line
name: twig_lint
description: twig-lint is a lint tool for your twig files.
default_stage: static_tests
icon: 🐘
maintainer: melheb.younes
license: MIT
images:
  "jakzal/phpqa": "7.4"
tools:
  "php": "7.4"
labels:
  - GitLab
  - PHP
  - Twig
+0 −0

Empty file added.

+12 −0
Original line number Diff line number Diff line
stages:
  - static_tests

twig_lint:
    image: 
      name: jakzal/phpqa:php7.4
      entrypoint: [""]
    stage: static_tests
    variables:
      TEMPLATE_PATH: "./templates"
    script:
      - twig-lint lint $TEMPLATE_PATH
+1 −0
Original line number Diff line number Diff line
* Initial version
 No newline at end of file