production: &production
  after_checkout:
    - source: /.cloud66/install_postgresql_client.sh
      destination: /tmp/install_postgresql_client.sh
      target: rails
      execute: true
      sudo: true
      apply_during: build_only
      run_on: all_servers
    - source: /.cloud66/install_new_relic_agent.sh
      destination: /tmp/install_new_relic_agent.sh
      target: rails
      execute: true
      sudo: true
      apply_during: build_only
      run_on: all_servers

  after_symlink:
    - source: /.cloud66/install_swagger.sh
      destination: /tmp/install_swagger.sh
      target: rails
      execute: true
      sudo: true
      apply_during: all
      run_on: all_servers

  after_rails:
    - command: erb .cloud66/log_files.yml.erb > /etc/log_files.yml
      sudo: true
      target: rails
      apply_during: build_only

    - source: /.cloud66/remote_syslog.init.d
      destination: /etc/init.d/remote_syslog
      sudo: true
      target: rails
      apply_during: build_only

    - source: /.cloud66/papertrail.sh
      destination: /tmp/papertrail.sh
      target: rails
      sudo: true
      execute: true
      apply_during: build_only

development:
  <<: *production

sandbox:
  <<: *production

staging:
  <<: *production

production: &production
  after_checkout:
    - source: /.cloud66/install_postgresql_client.sh
      destination: /tmp/install_postgresql_client.sh
      target: rails
      execute: true
      sudo: true
      apply_during: build_only
      run_on: all_servers
    - source: /.cloud66/install_new_relic_agent.sh
      destination: /tmp/install_new_relic_agent.sh
      target: any
      execute: true
      sudo: true
      apply_during: build_only
      run_on: all_servers

  after_symlink:
    - source: /.cloud66/install_swagger.sh
      destination: /tmp/install_swagger.sh
      target: rails
      execute: true
      sudo: true
      apply_during: all
      run_on: all_servers

  after_rails:
    - command: erb .cloud66/log_files.yml.erb > /etc/log_files.yml
      sudo: true
      target: rails
      apply_during: build_only

    - source: /.cloud66/remote_syslog.init.d
      destination: /etc/init.d/remote_syslog
      sudo: true
      target: rails
      apply_during: build_only

    - source: /.cloud66/papertrail.sh
      destination: /tmp/papertrail.sh
      target: rails
      sudo: true
      execute: true
      apply_during: build_only

development:
  <<: *production

sandbox:
  <<: *production

staging:
  <<: *production

Install the New Relic agent on all servers
Install the New Relic agent on all servers

