Navigation Menu

Skip to content

Commit

Permalink
adds travis config file (#873)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ZmagoD committed Nov 23, 2017
1 parent a2af2fc commit 2f66c1d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions .rspec
@@ -1,2 +1,3 @@
--require spec_helper
--format documentation
--color
8 changes: 8 additions & 0 deletions .travis.yml
@@ -0,0 +1,8 @@
sudo: required
install: true
services:
- docker
before_script:
- make docker
script:
- make tests-ci
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -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'
Expand Down
12 changes: 10 additions & 2 deletions Makefile
@@ -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)
Expand All @@ -14,6 +15,7 @@ DEFACE_ENABLED=false
endef
export PRODUCTION_CONFIG_BODY


all: docker database

heroku:
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Expand Up @@ -6,7 +6,7 @@
# 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,
Expand Down
4 changes: 2 additions & 2 deletions config/secrets.yml
Expand Up @@ -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:
Expand Down

0 comments on commit 2f66c1d

Please sign in to comment.