Commit 89eeec72 authored by Benjamin Neff's avatar Benjamin Neff

Merge branch 'master' into next-minor

parents 70410d16 2c9fec91
...@@ -24,15 +24,13 @@ branches: ...@@ -24,15 +24,13 @@ branches:
- 'develop' - 'develop'
before_install: before_install:
- gem install bundler - script/ci/prepare.sh
- mkdir travis-phantomjs - mkdir travis-phantomjs
- wget http://cifiles.diasporafoundation.org/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 - wget http://cifiles.diasporafoundation.org/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs - tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH - export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
bundler_args: "--deployment --without development --with mysql postgresql --jobs 3 --retry 3" script: "bin/rake --trace ci:travis:${BUILD_TYPE}"
script: "./script/ci/build.sh"
notifications: notifications:
irc: irc:
......
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
## Features ## Features
# 0.7.1.1
Fixes an issue with installing and running diaspora\* with today released bundler v1.16.0.
# 0.7.1.0 # 0.7.1.0
## Ensure account deletions are run ## Ensure account deletions are run
......
...@@ -4,9 +4,11 @@ require_relative 'boot' ...@@ -4,9 +4,11 @@ require_relative 'boot'
require 'rails/all' require 'rails/all'
require_relative "bundler_helper"
# Require the gems listed in Gemfile, including any gems # Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production. # you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups(*Bundler.settings.with)) Bundler.require(*Rails.groups(BundlerHelper.database))
# Do not dump the limit of boolean fields on MySQL, # Do not dump the limit of boolean fields on MySQL,
# since that generates a db/schema.rb that's incompatible # since that generates a db/schema.rb that's incompatible
......
# frozen_string_literal: true
require "yaml"
module BundlerHelper
def self.rails_env
@rails_env ||= ENV["RAILS_ENV"] ||
parse_value_from_file("diaspora.yml", "configuration", "server", "rails_environment") ||
parse_value_from_file("defaults.yml", "defaults", "server", "rails_environment")
end
def self.database
@adapter ||= parse_value_from_file("database.yml", rails_env, "adapter")
raise "No database adapter found, please fix your config/database.yml!" unless @adapter
@adapter.sub("mysql2", "mysql")
end
private_class_method def self.parse_value_from_file(file, *keys)
path = File.join(__dir__, file)
return YAML.load_file(path).dig(*keys) if File.file?(path)
puts "Configuration file #{path} not found, ensure it's present" # rubocop:disable Rails/Output
end
end
#!/bin/sh #!/bin/sh
# Create a database.yml for the right database # Create a database.yml for the right database
echo "Setting up database.yml for $DB" echo "Setting up database.yml for ${DB}"
cp config/database.yml.example config/database.yml cp config/database.yml.example config/database.yml
if [ "$DB" = "mysql" ]; then if [ "${DB}" = "mysql" ]; then
sed -i 's/*common/*mysql/' config/database.yml sed -i 's/*common/*mysql/' config/database.yml
fi fi
command="bundle exec rake --trace ci:travis:${BUILD_TYPE}" gem install bundler
script/configure_bundler
exec xvfb-run --auto-servernum --server-num=1 --server-args="-screen 0 1280x1024x8" $command
#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative "../config/bundler_helper"
rails_env = BundlerHelper.rails_env
database = BundlerHelper.database
puts "Configuring Bundler for #{rails_env} environment and #{database} database."
def config(option)
puts "$ bin/bundle config --local #{option}"
system("#{File.join(__dir__, '../bin/bundle')} config --local #{option}")
end
config("jobs #{`nproc`}")
config("with #{database}")
if rails_env == "production"
config("without test:development")
elsif rails_env == "test"
config("without development")
end
if rails_env != "development"
config("path vendor/bundle")
config("frozen 1")
config("disable_shared_gems true")
end
if `gcc -dumpversion`.split(".").first.to_i >= 5
config("build.sigar \"--with-cppflags='-fgnu89-inline'\"")
end
puts "Bundler configured! Please run 'bin/bundle install' now."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment