version: v1.0
name: Test ETEngine
agent:
  machine:
    type: e1-standard-2
    os_image: ubuntu2004
blocks:
  - name: RSpec
    task:
      jobs:
        - name: Test
          commands:
            - checkout
            - sem-service start mysql 8
            - cache restore
            - 'gem install bundler:1.17.3'
            - bundle install --deployment --path vendor/bundle
            - cache store
            - DATABASE_HOST=localhost bundle exec rails db:setup
            - DATABASE_HOST=localhost bundle exec rspec
promotions:
  - name: Deploy to staging
    pipeline_file: deploy_staging.yml
    auto_promote:
      when: "result = 'passed' and branch = 'master'"
  - name: Deploy to production
    pipeline_file: deploy_production.yml
    auto_promote:
      when: "result = 'passed' and branch = 'production'"

version: v1.0
name: Test ETEngine
agent:
  machine:
    type: e1-standard-2
    os_image: ubuntu2004
blocks:
  - name: RSpec
    task:
      env_vars:
        - name: DATABASE_HOST
          value: localhost
      jobs:
        - name: Test
          commands:
            - checkout
            - sem-service start mysql 8
            - cache restore
            - 'gem install bundler:1.17.3'
            - bundle install --deployment --path vendor/bundle
            - cache store
            - bundle exec rails db:setup
            - bundle exec rspec
promotions:
  - name: Deploy to staging
    pipeline_file: deploy_staging.yml
    auto_promote:
      when: "result = 'passed' and branch = 'master'"
  - name: Deploy to production
    pipeline_file: deploy_production.yml
    auto_promote:
      when: "result = 'passed' and branch = 'production'"

Move env vars in test pipeline
Move env vars in test pipeline
