docbrown/.travis.yml
Andy Zhao b2e18aeb72 Use Redis for session storage (#4004) [deploy]
* WIP use redis-session-store for sessions

* Use Redis as session storage

* Add redis-server to Travis

* Use integer for SESSION_EXPIRY_SECONDS env variable

Co-Authored-By: rhymes <rhymesete@gmail.com>

* Remove sessions b/c no custom sessions logic

* Use ApplicationConfig instead

* Rename default value

* Remove rememberable module

* Persist the user for the test

* Remove remember_me related tests

* Revert 'undo remember_me' commits

* Add redis to procfile

* Cleanup devise configuration

* Move REDIS configuration in the basic configuration section

* Make sure the expiration time can't zero

* Restore old order and remove useless comment line

* Delete legacy session cookie after login

Once deployed the server will start using the new session cookie, this makes sure the legacy one is deleted on the user's browser

* Remove redis from Procfile

* Add signed, secure and httponly to the Redis session cookie
2019-11-12 10:10:34 -06:00

60 lines
2.3 KiB
YAML

sudo: required
language: ruby
cache:
directories:
- vendor/bundle
- node_modules
- $HOME/.nvm
rvm:
- 2.6.5
addons:
postgresql: '9.6'
chrome: 'stable'
services:
- redis-server
env:
global:
- RAILS_ENV=test
- CC_TEST_REPORTER_ID=f39e060a8b1a558ebd8aff75d5b9760bf1ae98f3f85d628ae28814f3c66438cd
- DATABASE_URL=postgres://postgres@localhost/
branches:
only:
- master
before_install:
- date --rfc-3339=seconds
- nvm install
install:
- bundle install --path vendor/bundle
- yarn install
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
> ./cc-test-reporter
- chmod +x ./cc-test-reporter
before_script:
- bundle exec rails db:create
script:
- bundle exec rails webpacker:compile
- bundle exec rails db:schema:load
- './cc-test-reporter before-build'
- 'bundle exec rspec spec --color --tty'
- '[ ! -f .approvals ] || bundle exec approvals verify --ask false'
- './cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.simplecov.json'
- 'yarn test --colors'
- './cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.lcov.json'
- './cc-test-reporter sum-coverage coverage/codeclimate.*.json'
- './cc-test-reporter upload-coverage'
- 'bundle exec bundle-audit check --update --ignore CVE-2015-9284'
- yarn build-storybook
deploy:
provider: heroku
api_key: '$HEROKU_AUTH_TOKEN'
app:
master: practicaldev
on:
condition: $TRAVIS_COMMIT_MESSAGE =~ \[deploy\]
after_deploy:
- bash after_deploy.sh
notifications:
slack:
on_pull_requests: false
rooms:
secure: vzIee4jDgPSRY4szZPdD/jW7YW4GzGqo5NoLV9Exz9TBoWH9UqJnc0TOb2YN84Ys5baRK7LOqxpfp8kFveZkrKGi7/ypeEJlpc9E5UqVh/bwQhvOGrKEg1fvNXbARRnO/sJ49o1CMvroMWvt3GurzuuY9Qu2r+3NBjn9aVwLnLzXsBuF+m2lLoeSkHnW13OC73EeJMsse6JBoCe3gp/srDwISp9+MU+sEAPaY333WK9Vk1kdG7D5oUIuT7743airLRiyWiNUCD1450g864628CEOEZKJAAtqk6kTmvwB91DJMnhD/XhMm4H21kd54YHy0fhqzcG8hYd1lDZuUfrOBfpdEtfnpcRwMyMpY+FPPHXkHhck3OiLJnzkV4L+Lr5W/RvDJ63Ye2nxT4hOItLWaoZWax/LhoIrhZjgYBc4JhiGRQJ8m2HzoRyceeG9Y80vayGVN7y46sjYHP5NHRI36qmJipneDRAJklBTXLdYATvVM/6Mh9B7+H/nBGR6UVJLBC/txi2C8rZRjKBZ/i9e+q/MZs0UEvOuvbz9BXKU08rI+rarJqH3h5Ji9G/k3M0mQ8EfvadabA9lu+gNUAAnq+vwLETweKvfbRpDQjVBKnWsOJoUl9aarfkBn3lhQE8fxZJT/GchLGZPx/CWUE4o1OhliBA9avJ7WINyYStM4Mc=