Merge pull request #6003 from jhass/remove_db_hack
Replace DB environment variable with optional bundler groups
This commit is contained in:
commit
807b4f72bd
8 changed files with 41 additions and 27 deletions
|
|
@ -5,9 +5,9 @@ rvm:
|
|||
- 2.1
|
||||
|
||||
env:
|
||||
- DB=postgres BUILD_TYPE=other
|
||||
- DB=postgresql BUILD_TYPE=other
|
||||
- DB=mysql BUILD_TYPE=other
|
||||
- DB=postgres BUILD_TYPE=cucumber
|
||||
- DB=postgresql BUILD_TYPE=cucumber
|
||||
- DB=mysql BUILD_TYPE=cucumber
|
||||
|
||||
sudo: false
|
||||
|
|
@ -23,7 +23,7 @@ branches:
|
|||
- 'develop'
|
||||
|
||||
before_install: gem install bundler
|
||||
bundler_args: "--without development production heroku --jobs 3 --retry 3"
|
||||
bundler_args: "--deployment --without development production --with mysql postgresql --jobs 3 --retry 3"
|
||||
|
||||
script: "./script/ci/build.sh"
|
||||
|
||||
|
|
|
|||
14
Changelog.md
14
Changelog.md
|
|
@ -1,5 +1,19 @@
|
|||
# 0.6.0.0
|
||||
|
||||
## The DB environment variable is gone
|
||||
|
||||
With Bundler 1.10 supporting optional groups, we removed the DB environment variable. When updating to this release, please update
|
||||
bundler and select the database support you want:
|
||||
|
||||
```sh
|
||||
gem install bundler
|
||||
bundle install --with mysql # For MySQL and MariaDB
|
||||
bundle install --with postgresql # For PostgreSQL
|
||||
```
|
||||
|
||||
For production setups we now additionally recommend adding the `--deployment` flag.
|
||||
If you set the DB environment variable anywhere, that's no longer necessary.
|
||||
|
||||
## Supported Ruby versions
|
||||
|
||||
This release recommends using Ruby 2.2, while retaining Ruby 2.1 as an officially supported version.
|
||||
|
|
|
|||
10
Gemfile
10
Gemfile
|
|
@ -60,10 +60,12 @@ gem "autoprefixer-rails", "5.1.11"
|
|||
|
||||
# Database
|
||||
|
||||
ENV["DB"] ||= "mysql"
|
||||
|
||||
gem "mysql2", "0.3.18" if ENV["DB"] == "all" || ENV["DB"] == "mysql"
|
||||
gem "pg", "0.18.1" if ENV["DB"] == "all" || ENV["DB"] == "postgres"
|
||||
group :mysql, optional: true do
|
||||
gem "mysql2", "0.3.18"
|
||||
end
|
||||
group :postgresql, optional: true do
|
||||
gem "pg", "0.18.1"
|
||||
end
|
||||
|
||||
gem "activerecord-import", "0.7.0"
|
||||
|
||||
|
|
|
|||
|
|
@ -466,6 +466,7 @@ GEM
|
|||
orm_adapter (0.5.0)
|
||||
parser (2.2.2.2)
|
||||
ast (>= 1.1, < 3.0)
|
||||
pg (0.18.1)
|
||||
phantomjs (1.9.8.0)
|
||||
powerpack (0.1.1)
|
||||
pry (0.10.1)
|
||||
|
|
@ -789,6 +790,7 @@ DEPENDENCIES
|
|||
omniauth-twitter (= 1.0.1)
|
||||
omniauth-wordpress (= 0.2.1)
|
||||
open_graph_reader (= 0.6.1)
|
||||
pg (= 0.18.1)
|
||||
pry
|
||||
pry-byebug
|
||||
pry-debundle
|
||||
|
|
@ -854,3 +856,6 @@ DEPENDENCIES
|
|||
uuid (= 2.3.7)
|
||||
webmock (= 1.21.0)
|
||||
will_paginate (= 3.0.7)
|
||||
|
||||
BUNDLED WITH
|
||||
1.10.0
|
||||
|
|
|
|||
|
|
@ -1,3 +1,11 @@
|
|||
postgresql: &postgresql
|
||||
adapter: postgresql
|
||||
host: localhost
|
||||
port: 5432
|
||||
username: postgres
|
||||
password:
|
||||
encoding: unicode
|
||||
|
||||
mysql: &mysql
|
||||
adapter: mysql2
|
||||
host: "localhost"
|
||||
|
|
@ -8,20 +16,13 @@ mysql: &mysql
|
|||
encoding: utf8mb4
|
||||
collation: utf8mb4_bin
|
||||
|
||||
postgres: &postgres
|
||||
adapter: postgresql
|
||||
host: localhost
|
||||
port: 5432
|
||||
username: postgres
|
||||
password:
|
||||
encoding: unicode
|
||||
|
||||
# Comment the the mysql line and uncomment the postgres line
|
||||
# if you want to use postgres
|
||||
common: &common
|
||||
# Choose one of the following
|
||||
<<: *mysql
|
||||
#<<: *postgres
|
||||
<<: *postgresql
|
||||
#<<: *mysql
|
||||
|
||||
# Should match environment.sidekiq.concurrency
|
||||
#pool: 25
|
||||
|
|
@ -32,9 +33,6 @@ common: &common
|
|||
|
||||
# Normally you don't need to touch anything here
|
||||
|
||||
postgres_travis: &postgres_travis
|
||||
adapter: postgresql
|
||||
username: postgres
|
||||
combined: &combined
|
||||
<<: *common
|
||||
development:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ end
|
|||
|
||||
Eye.application("diaspora") do
|
||||
working_dir Rails.root.to_s
|
||||
env "DB" => ENV["DB"], "RAILS_ENV" => rails_env
|
||||
env "RAILS_ENV" => rails_env
|
||||
stdout "log/eye_processes_stdout.log" unless rails_env == "development"
|
||||
stderr "log/eye_processes_stderr.log"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
# Create a database.yml for the right database
|
||||
echo "Setting up database.yml for $DB"
|
||||
cp config/database.yml.example config/database.yml
|
||||
if [ "$DB" = "postgres" ]; then
|
||||
sed -i 's/*common/*postgres_travis/' config/database.yml
|
||||
if [ "$DB" = "mysql" ]; then
|
||||
sed -i 's/*common/*mysql/' config/database.yml
|
||||
fi
|
||||
|
||||
command="bundle exec rake --trace ci:travis:${BUILD_TYPE}"
|
||||
|
|
|
|||
|
|
@ -113,11 +113,6 @@ vars=$(bin/bundle exec ruby ./script/get_config.rb \
|
|||
on_failure "Couldn't parse config/diaspora.yml!"
|
||||
eval "$vars"
|
||||
|
||||
if [ -n "$DB" ]
|
||||
then
|
||||
export DB
|
||||
fi
|
||||
|
||||
args="$@"
|
||||
for arg in $(echo $args | awk '{ for (i = 1; i <= NF; i++) print $i}')
|
||||
do
|
||||
|
|
|
|||
Loading…
Reference in a new issue