Skip to content

Qaack file examples

Complete qaack.yml files you can copy. For what each option means, see the Qaack file reference.

Annotated template

Every optional block is commented out — uncomment what you need.

# Qaackfile example
# Full documentation: https://docs.qaack.cloud/specifications/qaack-file/

# WEBPROXY ALIASES
# this option allows to access the environment from multiple subdomains
# more info: https://docs.qaack.cloud/definitions/environment/#webproxy
#aliases:
#  - my-other-site
#  - ...
# Name shown for the environment's own site. Defaults to "default".
#default_alias: mainsite


# TESTS
# define which tests to run
#tests:
  # the label will identify the test run in the UI
  #label:
    #type: lighthouse # requires, it can be lighthouse, playwright, visual-regression
    #params: # optional parameters
      #paths:
      #  - /
      #  - /page1
      #  - /node/123
      #threshold: 90

  #basic_pw:
  #  type: playwright
  #  params:
  #    dir: test/my-tests # relative to the project root, default is test/playwright
  #vr:
    #type: visual-regression
    #params:
      #paths:
      #  - /
      #threshold: 99


# QUICK ACTIONS
# allows to run commands easily from the UI
#quick_actions:
  # the label will appear in the UI
  #label:
    # the command to run, allows [[ .Alias.URI ]] and [[ .Alias.Name ]] 
    #command: echo [[ .Alias.URI ]] - [[ .Alias.Name ]]
    # the output type, text or file, default text
    #output: text
  #get_readme:
    #command: cat Readme.md
    #output: file
    # the filename to use for the output file
    #filename: qaack-readme.md


# REUSABILITY
# allows to build the environment from other environment
# with make_reusable you specify when to create the reusable snapshot
# more info: https://docs.qaack.cloud/definitions/environment/#reusables
#make_reusable:
  # label of the reusable environment
  #reusable_name:
    # execution point to create the reusable snapshot
    #on: service.step
    # branch to create the reusable snapshot
    #where:
    #  - branch

# with reuse you specify which reusable snapshot to use
#reuse: reusable_name


# SERVICES
# mandatory to define the services
services:
  # name of the service, used too as hostname
  db:
    image: qaack/mariadb

  web: 
    image: qaack/nginx-php81
    default: true
    checkout: true # will clone the repository and checkout the proper reference
    #port: 8080 # optional, by default 80, Qaack handles TLS termination
    #start: "" # optional, by default the container CMD is used
    commands:
      provision:
        - rm -rf /usr/share/nginx/html
        - ln -s $(pwd)/ /usr/share/nginx/html
        - echo "<h1>Hello from Qaack!</h1>" > index.php
        - echo "Hello!"

Reusables, variables, quick actions and tests

A filled-in file combining most of the optional blocks.

make_reusable:
  reusable1:
    on: Y.b
    where:
      - develop
  full_site:
    on: Z.f
    where:
      - develop

reuse: full_site

variables:
  var1: value1
  var2:
    value: value2

quick_actions:
  get_file:
    label: Read file
    description: Outputs the contents of my_file
    command: cat my_file
  reinstall_packages:
    command: npm ci
    output: none
  dump_database:
    command: "mysqldump | gzip"
    output: file
    service: mariadb
    filename: dump.sql.gz

tests:
  home-screenshot:
    type: screenshot
  lighthouse:
    type: lighthouse

services:
  web:
    image: qaack/nginx-php81
    checkout: true
  db:
    image: qaack/mariadb

Conditional templating

Services defined per repository type, using templating.

services:
  php1:
    image: qaack/nginx-php74

  {{ if eq .Repository.Type "gitlab" }}
  phpGitlab:
    image: qaack/nginx-php74
    commands:
      dummy:
        - echo ID {{ RepositoryParam "GitlabProjectId" }}
        - echo Group {{ RepositoryParam "GitlabProjectGroup" }}
  {{ end }}

  {{ if eq .Repository.Type "generic"}}
  phpGeneric:
    image: qaack/nginx-php74
    commands:
      info:
        - echo {{ .Environment.Ref.Type }}
        - echo {{ .Repository.Type }}
  {{ end }}