Travis automerge/deploy

191 Views Asked by At

I'm trying to get Travis CI working to auto-deploy and merge branches to master. Here is the script I'm using. On build success, it says that it is skipping deploy because it's not on the right branch, and that's why I want it to merge the branch is the build is successful. Any tips?

script:
  - export RAILS_ENV=test
  - bundle exec rake db:create db:schema:load db:test:prepare
  - bundle exec rspec --color --format documentation --require spec_helper --require rails_helper
  - bundle exec brakeman --exit-on-warn --quiet -f plain
before_script:
  - bundle exec rake db:create
  - RAILS_ENV=test bundle exec rake db:migrate --trace
  - bundle exec rake db:test:prepare
deploy: &heroku
  provider: heroku
  api_key:
    secure: encrypted travis key
    app: herokuapp.com
    run: rake db:migrate
    strategy: git
    env:
      global:
        secure: encrytped github key
after_success:
  - "curl -o /tmp/travis-automerge https://raw.githubusercontent.com/mikeyduece/travis-automerge/master/travis-automerge"
  - "chmod a+x /tmp/travis-automerge/merge.sh"
  - "BRANCH_TO_MERGE_INTO=* GITHUB_REPO=user/repo /tmp/travis-automerge"
notifications:
  email: false
0

There are 0 best solutions below