# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.

image: php:7.2

pipelines:
  branches:
    master:
     - step:
        caches:
          - composer
        script:
           - apt-get update && apt-get install -y unzip
           - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
           - apt-get -qq install git-ftp
           - git ftp init --user $FTP_PROD_USERNAME --passwd $FTP_PROD_PASSWORD $FTP_PROD_HOST
           
    staging:
     - step:
        caches:
          - composer
        script:
           - apt-get update && apt-get install -y unzip
           - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
           - apt-get -qq install git-ftp
           - git ftp init --user $FTP_STG_USERNAME --passwd $FTP_STG_PASSWORD $FTP_STG_HOST
           
           
    development:
     - step:
        caches:
          - composer
        script:
           - apt-get update && apt-get install -y unzip
           - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
           - apt-get -qq install git-ftp
           - git ftp init --user $FTP_DEV_USERNAME --passwd $FTP_DEV_PASSWORD $FTP_DEV_HOST       
        