Skip to content

Commit

Permalink
build: Fix local installation
Browse files Browse the repository at this point in the history
* fix import of `chroma-js` with `ember-auto-import`
* add environment variables in `docker-compose.override.yml` so you can
partly start the database and redis
* fix: race condition in cucumber
* build: Update pg
* build: update Capfile lock
* ci: Add deployment .ini files for uberspace
* build: Update capistrano
* fix: Really annoying bug in supervisorctl
    used `env -i bin/bundle rails exec server` to debug
* fix: Piwik url
  • Loading branch information
roschaefer committed Sep 11, 2020
1 parent b1926a0 commit f9505ad
Show file tree
Hide file tree
Showing 41 changed files with 2,193 additions and 240 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.1
2.6.6
20 changes: 4 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
dist: trusty
dist: xenial
language: ruby
sudo: required
rvm:
- 2.4.1
services:
- redis-server
- postgres
addons:
ssh_known_hosts: rundfunk-mitbestimmen.de
postgresql: "9.6"
chrome: stable
apt:
sources:
- google-chrome
packages:
- google-chrome-stable

before_install:
- . $HOME/.nvm/nvm.sh
Expand All @@ -34,6 +27,7 @@ install:
- cd backend && bundle
- cd ../frontend && yarn install --pure-lockfile
- cd ..
- bundle exec rake webdrivers:chromedriver:update


before_script:
Expand Down Expand Up @@ -66,17 +60,11 @@ before_deploy:
- eval "$(ssh-agent -s)"
- chmod 600 /tmp/deploy_rsa
- ssh-add /tmp/deploy_rsa
- rvm $TRAVIS_RUBY_VERSION do gem install bundler capistrano capistrano-rails capistrano-db-tasks

deploy:
- provider: script
skip_cleanup: true
script: cd backend && rvm $TRAVIS_RUBY_VERSION do cap staging deploy && cd ../frontend && ember deploy staging
on:
branch: staging
- provider: script
skip_cleanup: true
script: cd backend && rvm $TRAVIS_RUBY_VERSION do cap production deploy && cd ../frontend && ember deploy production
script: ./deployment/scripts/deploy.sh
on:
branch: master

Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ gem 'activerecord' # Database Access
gem 'activesupport' # For Autoloading model classes like Rails
gem 'capybara'
gem 'childprocess' # For managing the running Rails and Ember Apps
gem 'chromedriver-helper' # Headless Browser Testing
gem 'cucumber' # Human Readable Specification by Example
gem 'database_cleaner' # Clean the Database between runs
gem 'rake'
gem 'rspec-expectations' # Expectations Library
gem 'selenium-webdriver'
gem 'webdrivers'
41 changes: 19 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ GEM
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.3.0)
sshkit (>= 1.6.1, != 1.7.0)
archive-zip (0.11.0)
io-like (~> 0.3.0)
arel (8.0.0)
ast (2.4.0)
backports (3.11.3)
Expand All @@ -83,22 +81,19 @@ GEM
capistrano-rails (1.4.0)
capistrano (~> 3.1)
capistrano-bundler (~> 1.1)
capybara (3.14.0)
capybara (3.33.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.2)
regexp_parser (~> 1.5)
xpath (~> 3.2)
case_transform (0.2)
activesupport
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
choice (0.2.0)
chromedriver-helper (2.1.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
chrono_model (0.12.1)
activerecord (>= 4.2.0, < 5.2.0)
multi_json
Expand Down Expand Up @@ -146,7 +141,6 @@ GEM
highline (2.0.1)
i18n (1.5.3)
concurrent-ruby (~> 1.0)
io-like (0.3.0)
jaro_winkler (1.5.2)
json_matchers (0.10.0)
json_schema
Expand Down Expand Up @@ -182,7 +176,7 @@ GEM
mail (2.7.1)
mini_mime (>= 0.1.1)
method_source (0.9.2)
mini_mime (1.0.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.11.3)
multi_json (1.13.1)
Expand All @@ -192,7 +186,7 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (5.0.2)
nio4r (2.3.1)
nokogiri (1.10.1)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
paper_trail (10.1.0)
activerecord (>= 4.2, < 6.0)
Expand All @@ -209,9 +203,9 @@ GEM
coderay (~> 1.1.0)
method_source (~> 0.9.0)
psych (3.1.0)
public_suffix (3.0.3)
public_suffix (4.0.6)
puma (3.12.0)
rack (2.0.6)
rack (2.2.3)
rack-cors (1.0.2)
rack-protection (2.0.5)
rack
Expand Down Expand Up @@ -260,7 +254,7 @@ GEM
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
redis (4.1.0)
regexp_parser (1.3.0)
regexp_parser (1.7.1)
request_store (1.4.1)
rack (>= 1.4)
rgeo (2.0.0)
Expand Down Expand Up @@ -299,14 +293,14 @@ GEM
ruby-graphviz (1.2.3)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
rubyzip (1.2.2)
rubyzip (2.3.0)
safe_yaml (1.0.4)
scenic (1.5.1)
activerecord (>= 4.0.0)
railties (>= 4.0.0)
selenium-webdriver (3.141.0)
childprocess (~> 0.5)
rubyzip (~> 1.2, >= 1.2.2)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
sentry-raven (2.9.0)
faraday (>= 0.7.6, < 1.0)
sidekiq (5.2.5)
Expand Down Expand Up @@ -342,6 +336,10 @@ GEM
activemodel (>= 3.2)
mail (~> 2.5)
vcr (4.0.0)
webdrivers (4.4.1)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
webmock (3.5.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
Expand All @@ -367,7 +365,6 @@ DEPENDENCIES
capistrano-rails
capybara
childprocess
chromedriver-helper
chrono_model (<= 0.12.1)
cucumber
database_cleaner
Expand Down Expand Up @@ -397,7 +394,6 @@ DEPENDENCIES
rspec-rails
rubocop
scenic
selenium-webdriver
sentry-raven
sidekiq
sidekiq-unique-jobs
Expand All @@ -406,7 +402,8 @@ DEPENDENCIES
tzinfo-data
valid_email2
vcr
webdrivers
webmock

BUNDLED WITH
1.16.2
2.1.4
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'
require 'rubocop/rake_task'
require 'webdrivers'

load 'webdrivers/Rakefile'

RuboCop::RakeTask.new(:rubocop) do |task|
# Make it easier to disable cops.
Expand Down
32 changes: 16 additions & 16 deletions backend/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
airbrussh (1.3.0)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
arel (8.0.0)
ast (2.4.0)
Expand All @@ -72,7 +72,7 @@ GEM
brakeman (4.4.0)
builder (3.2.3)
cancancan (2.3.0)
capistrano (3.11.0)
capistrano (3.14.1)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand All @@ -91,7 +91,7 @@ GEM
multi_json
pg
coderay (1.1.2)
concurrent-ruby (1.1.4)
concurrent-ruby (1.1.7)
connection_pool (2.2.2)
crack (0.4.3)
safe_yaml (~> 1.0.0)
Expand All @@ -116,7 +116,7 @@ GEM
globalize (~> 5.0, >= 5.0.0)
hashdiff (0.3.7)
highline (2.0.1)
i18n (1.5.3)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jar-dependencies (0.4.0)
jaro_winkler (1.5.2)
Expand Down Expand Up @@ -157,12 +157,12 @@ GEM
method_source (0.9.2)
mini_mime (1.0.1)
mini_portile2 (2.4.0)
minitest (5.11.3)
multi_json (1.13.1)
minitest (5.14.2)
multi_json (1.15.0)
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (5.0.1)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (6.1.0)
nio4r (2.3.1)
nio4r (2.3.1-java)
nokogiri (1.10.1)
Expand All @@ -178,9 +178,9 @@ GEM
parallel (1.13.0)
parser (2.6.0.0)
ast (~> 2.4.0)
pg (1.1.4)
pg (1.1.4-x64-mingw32)
pg (1.1.4-x86-mingw32)
pg (1.2.3)
pg (1.2.3-x64-mingw32)
pg (1.2.3-x86-mingw32)
pg_search (2.1.4)
activerecord (>= 4.2)
activesupport (>= 4.2)
Expand Down Expand Up @@ -244,7 +244,7 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
rake (12.3.2)
rake (13.0.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
Expand Down Expand Up @@ -316,13 +316,13 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sshkit (1.16.1)
sshkit (1.21.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
thor (0.20.3)
thread_safe (0.3.6)
thread_safe (0.3.6-java)
tzinfo (1.2.5)
tzinfo (1.2.7)
thread_safe (~> 0.1)
tzinfo-data (1.2018.5)
tzinfo (>= 1.0.0)
Expand Down Expand Up @@ -392,4 +392,4 @@ DEPENDENCIES
webmock

BUNDLED WITH
1.16.1
2.1.4
4 changes: 2 additions & 2 deletions backend/config/database.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ default: &default
adapter: chronomodel
encoding: unicode
pool: 20
username: <%= ENV["POSTGRES_USERNAME"] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
username: <%= ENV["POSTGRES_USERNAME"] || 'postgres' %>
password: <%= ENV["POSTGRES_PASSWORD"] || 'postgres'%>
host: <%= ENV["POSTGRES_HOST"] || 'localhost' %>

development:
Expand Down
4 changes: 2 additions & 2 deletions backend/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ default: &default
adapter: chronomodel
encoding: unicode
pool: 20
username: <%= ENV["POSTGRES_USERNAME"] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
username: <%= ENV["POSTGRES_USERNAME"] || 'postgres' %>
password: <%= ENV["POSTGRES_PASSWORD"] || 'postgres' %>
host: <%= ENV["POSTGRES_HOST"] || 'localhost' %>

development:
Expand Down
2 changes: 1 addition & 1 deletion backend/config/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# config valid only for current version of Capistrano
lock '3.11.0'
lock '3.14.1'

set :application, 'rundfunk-backend'
set :repo_url, 'https://github.com/roschaefer/rundfunk-mitbestimmen.git'
Expand Down
2 changes: 1 addition & 1 deletion backend/config/deploy/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
# server 'db.example.com', user: 'deploy', roles: %w{db}
server 'rundfunk-mitbestimmen.de', user: 'rfmb', roles: %w[app db web]
server 'skiff.uberspace.de', user: 'rfmb', roles: %w[app db web]
set :deploy_to, '/home/rfmb/rundfunk-backend/'

# role-based syntax
Expand Down
Loading

0 comments on commit f9505ad

Please sign in to comment.