adds travis config file (#873)

* adds travis config file

* add dist to travis

* adds script section

* test env

* remove globals

* adds hashed variables

* add matrix

* removed matrix

* test env

* testing

* test

* update Gemfile

* test travis

* test

* test

* test travis

* test

* build with docker

* test

* test

* ads

* add devise secre

* test travis

* test

* test

* test

* adds travis db configurations

* make travis happy

* test

* test

* test

* test

* test

* test

* testing devise

* test

* test

* teset

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* edit env

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* final commit

* test

* cleanup

* cleanup
This commit is contained in:
Zmago Devetak 2017-11-23 09:55:57 +01:00 committed by GitHub
parent a2af2fcd7c
commit 2f66c1df25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 6 deletions

1
.rspec
View file

@ -1,2 +1,3 @@
--require spec_helper
--format documentation
--color

8
.travis.yml Normal file
View file

@ -0,0 +1,8 @@
sudo: required
install: true
services:
- docker
before_script:
- make docker
script:
- make tests-ci

View file

@ -106,7 +106,7 @@ end
group :test do
gem 'shoulda-matchers'
gem 'cucumber-rails', '~> 1.5'
gem 'cucumber-rails', '~> 1.5', require: false
gem 'database_cleaner'
gem 'capybara'
gem 'capybara-email'

View file

@ -1,5 +1,6 @@
APP_HOME="/usr/src/app"
DB_IP=$(shell docker inspect scinote_db_development | grep "\"IPAddress\": " | awk '{ match($$0, /"IPAddress": "([0-9\.]*)",/, a); print a[1] }')
PAPERCLIP_HASH_SECRET=$(shell openssl rand -base64 128 | tr -d '\n')
define PRODUCTION_CONFIG_BODY
SECRET_KEY_BASE=$(shell openssl rand -hex 64)
@ -14,6 +15,7 @@ DEFACE_ENABLED=false
endef
export PRODUCTION_CONFIG_BODY
all: docker database
heroku:
@ -74,8 +76,14 @@ cli:
cli-production:
@$(MAKE) rails-production cmd="/bin/bash"
tests:
@$(MAKE) rails cmd="rake test"
unit-tests:
@$(MAKE) rails cmd="bundle exec rspec"
integration-tests:
@$(MAKE) rails cmd="bundle exec cucumber"
tests-ci:
@docker-compose run -e PAPERCLIP_HASH_SECRET=PAPERCLIP_HASH_SECRET -e PAPERCLIP_STORAGE=filesystem -e ENABLE_TUTORIAL=false -e ENABLE_RECAPTCHA=false -e ENABLE_USER_CONFIRMATION=false -e ENABLE_USER_REGISTRATION=true --rm web bash -c "bundle install && rake db:create db:migrate && rake db:migrate RAILS_ENV=test && yarn install && bundle exec rspec && bundle exec cucumber"
console:
@$(MAKE) rails cmd="rails console"

View file

@ -6,7 +6,7 @@ Devise.setup do |config|
# confirmation, reset password and unlock tokens in the database.
# Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
# by default. You can change it below and use your own secret key.
# config.secret_key = '541693b548daa586c6f7d4d4ac38de22e7d46b64ff85492ca05bb176b3b18249d6dbcf74b419a7d680146c6f6173b9c780d77e10580d98b0dc7f8f0c18efae9a'
# config.secret_key = '8d3a7b1acfb05057553abeb1ee4709f9f2d7e2fa1e5e60e7f45ab2e9244c301adcf0d146ae7cf74ba03c39c5bf895f08606a9f98051478ac4c6a695cafb4007a'
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,

View file

@ -57,11 +57,11 @@ common: &common
# ======================================================================
development:
secret_key_base: <%= ENV["DEVELOPMENT_KEY_BASE"] %>
secret_key_base: 22f2adf8f5cb73351da28f2292daa840cc2a414ae00ae605b175a8d5c73932f7e5b8ff8ef8f1554a7f1064f9869b15347f7709f0daa6ccb24c50f3cace304f64
<<: *common
test:
secret_key_base: <%= ENV["TEST_KEY_BASE"] %>
secret_key_base: f3719934e04fa8871cf5d33d5c60f05e1b8995e0315265aef9f8b878da49bd2d386eb25ce35545b469a94ccf22f91e0052b93a15194b4f57b0c8d6ce8b150e1e
<<: *common
production: