The Squash YAML file

You can define a .squash.yml at the root level of your repository. This file provides greater flexibility to control the build and execution of each deployment.

Squash works out of the box without the need of a .squash.yml file. In this case Squash searches for a Dockerfile or docker-compose.yml file within the root path of your application code. More detail on the deployment build process.

Troubleshooting YAML file issues

You may use a YAML validator if you are unsure if your Squash YAML file is valid.

The .squash.yml structure

The .squash.yml file is organized by applications, supporting multiple apps within the same repo. Squash supports applications based on Docker or entirely described in the YAML file, for repositories that are not Docker based. We also support Kubernetes deployments.

deployments:
  AppName1:
        filename:
          ./src/DockerfileABC
  AppName2:
        filename:
          ./src/DockerfileXYZ

For the examples above, AppName1 and AppName2 are mandatory and are meant to be customized, they define a user friendly name for each application, this name will also be displayed in the Squash PR comments.

Here is a typical .squash.yml file for a single application based on Docker:

deployments:
  CRM:
    filename:
      ./src/CRM/docker-compose.yml
    context_path:
      ./src
    vm_size:
      2GB
    ready_wait:
      # This will tell Squash to wait up to 20 min (1200 seconds) for a
      # success response from the app. The count down only starts after
      # the build process is finished.
      1200

And here is a sample Squash YAML file for an application that doesn’t use Docker:

deployments:
  default:
    dockerimage: python:latest
    build_steps:
      - apt-get update && apt-get install -y libssl-dev libpq-dev git build-essential libfontconfig1 libfontconfig1-dev curl
      - RUN bash -c "curl -sL https://deb.nodesource.com/setup_8.x | bash -"
      - apt install -y nodejs
      - pip install setuptools pip --upgrade --force-reinstall
      - cd /code
    post_build_steps:  
      - npm install --no-save
      - npm run dist
      - pip install /code
      - mkdir /myproject
      - cd /myproject
      - wagtail start mysite
      - cd /myproject/mysite
      - python manage.py migrate
      - echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@myproject.com', 'password')" | python manage.py shell    
    launch_steps:
      - cd /myproject/mysite
      - python manage.py runserver 0.0.0.0:80
    run_options: -v ~/code:/code

Below is a comprehensive guide on each supported YAML field and use cases for both YAML based apps and applications using Docker.

Global YAML fields

These YAML fields are supported on any application type (Docker, Kubernetes or non-Docker based).

See Global YAML fields.

Docker specific fields

See Docker-specific YAML fields.

Kubernetes specific fields

See Kubernetes-specific YAML fields.

YAML based fields

See YAML (non-Docker) specific fields.