Build Config Reference

Below, you find a reference for the entire build section. We recommend to only copy parts you need in your configuration, and otherwise use our defaults:

build:
    environment:
        # Any valid timezone identifier
        # see TZ column on https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
        timezone:             UTC

        # Sets up DNS entries for certain hosts
        hosts:
            local.dev:            127.0.0.1
            another-domain.dev:   127.0.0.1

        # Any environment variables we should set for you.
        variables:
            FOO:                  bar
            ANOTHER_VAR:          baz

        # Your heroku credentials for deployment if needed.
        # Recommended to be kept on the website only.
        heroku:
            email:                [email protected]
            api_key:              heroku-api-key

        # Your aws credentials for the aws CLI used for deployment or other tasks.
        # Recommended to be kept on the website only.
        aws:
            key:                  aws-key-here
            secret:               aws-secret-here

        # Languages
        php:
            version:              "7.0"
            ini:
                memory_limit:     "-1"

        java:                     "java-8-oracle"
        python:                   "3.5.0"
        ruby:                     "2.3.1"
        node:                     "v6.2.0"
        go:                       "go1.6.2"

        # Various pre-installed services that can be configured.
        docker:
            logins:
            - { username: "user", password: "s3cret", server: "docker.io" }
            - # more logins

            cache:
                images:
                - "scrutinizer/web:tag-name"
                - "scrutinizer/*"

        mysql:                    5.5
        postgresql:           true
        redis:                true
        apache2:
            modules:              []
            sites:
                my-site-name:
                    host:      local.dev # also make sure to add under "hosts" above
                    web_root:  web/
                    rules:
                        - RewriteRule # ...
                        - AnotherEntry # will be added to the <VirtualHost> entry of this site

        elasticsearch:        "2"
        rabbitmq:             false
        mongodb:              false
        neo4j:                false
        memcached:            false
        selenium:
            version:                2.53
            chrome_driver_version:  2.22
            browser_name:           ~     # can also be set from your tests

    cache:
        disabled:             false

        # Accepts an array of directories
        directories:
            - ~/relative-to-the-users-home
            - ~/.m2

            - or-relative-to-your-project
            - vendor/

    # Used for installing any needed dependencies by your project like apt package or libraries.
    dependencies:
        # Commands that should be run before the inferred commands in the dependencies section
        before:
            - simple-command-string
            - and-another-command-string

            # or a full command hash
            -
                command:              some-command
                cwd:                  .

                # How long in seconds we should wait for the command to produce some output before
                # we consider it broken and terminate it.
                idle_timeout:         180

                environment:
                    SOME_KEY:         VALUE
                    ANOTHER_KEY:      VALUE

                # If true, this command will be run in the background.
                background:           false

                # A node number, when you want to run builds in parallel. You can configure any number here.
                # All commands with the same number will be run in the same container. Commands with no
                # explicit number configured will run in all containers.
                on_node:              ~  # 1, 2, 3, and so on

                # Helpers to execute a command conditionally, accepts any command valid command.
                # Useful if you want to cache an expensive compilation for example.
                only_if:              "test -e command-is-only-executed-if-this-path-exists"
                not_if:               ~

                # Optional. If the command produces a coverage file, you can let the platform know where and
                #           what format it has, so we can correctly process it and show you the results.
                #           See dedicated code coverage section for details.
                coverage:
                    file:                 ~
                    config_file:          ~
                    format:               ~

                # Optional. If the command produces analysis results, sometimes it's necessary to explicit
                #           configure the result file and its format. See dedicated open-source tools
                #           section for details.
                analysis:
                    file:                 ~
                    format:               ~

        # Commands that should be run instead of the inferred commands in the dependencies section.
        override:
            # Same format as above in "before".
            # If you want to override the inferred commands, you can move your entire "before"
            # and "after" commands into the "override" section. If you do not have any commands
            # in those sections, you can also just add "true" as command which is bash built-in.


        # Commands that should be run after the inferred commands in the dependencies section.
        after:
            # Same format as above in "after".
            # Useful if you want to keep the inferred commands, and just add something
            # after they have run.

    # Follows the same structure like the dependencies section.
    # Used for project setup like configuring the database, preparing the schema, importing fixtures, etc.
    project_setup:
        before: []
        override: []
        after: []

    # Follows the same structure like the dependencies section.
    # Used for running your tests and open-source analysis tools.
    # We will execute all commands even if one of them fails.
    tests:
        # If true, tests execution will stop by any command failure.
        stop_on_failure: true
        before:
            -
                command:
                stop_on_failure: true # If true, tests execution will stop when this command failed.
        override: []
        after: []

    # Used for deployment.
    # Will only be executed if all tests succeeded.
    # If run in parallel, will be executed in the container where tests finish last.
    deployment:
        -
            # Optional. If this should only be executed for pushes to a certain branch.
            branch:               master
            commands:
                - aws s3 cp my-file s3://my-bucket/my-file
                - git push heroku master
                - or-any-other-command