Skip to content

Commit

Permalink
Merge pull request #4545 from hennevogel/bugfix/4131
Browse files Browse the repository at this point in the history
Introduces mailcatcher into development mode
  • Loading branch information
hennevogel committed Feb 23, 2018
2 parents 0fba2c8 + eb82f6c commit ece825e
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- .:/obs
ports:
- "3000:3000"
- "1080:1080"
depends_on:
- db
- cache
Expand Down
1 change: 1 addition & 0 deletions docker-files/base/docker-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ do
phantomjs \
nodejs6 npm6 \
mariadb-client \
sqlite3-devel \
git-core \
ruby2.5-devel cyrus-sasl-devel openldap2-devel libxml2-devel zlib-devel libxslt-devel \
perl-XML-Parser \
Expand Down
2 changes: 1 addition & 1 deletion src/api/Dockerfile.frontend-base
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN for i in ruby gem irb; do ln -s /usr/bin/$i.ruby2.5 /usr/local/bin/$i; done

# foreman, which we only run in docker, needs a different thor version than OBS.
# Installing the gem directly spares us from having to rpm package two different thor versions.
RUN gem.ruby2.5 install --no-format-executable thor:0.19 foreman
RUN gem.ruby2.5 install --no-format-executable thor:0.19 foreman mailcatcher

# We copy the Gemfiles into this intermediate build stage so it's checksum
# changes and all the subsequent stages (a.k.a. the bundle install call below)
Expand Down
1 change: 1 addition & 0 deletions src/api/Procfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ web: bundle exec rails server
delayed: bundle exec script/delayed_job.api.rb run
clock: bundle exec clockworkd --log-dir=log -l -c config/clock.rb run
search: bundle exec rake ts:rebuild NODETACH=true
mailcatcher: mailcatcher --ip 0.0.0.0 -f --no-quit -v
2 changes: 1 addition & 1 deletion src/api/app/models/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def write_to_backend
# http_proxy :string(255)
# no_proxy :string(255)
# theme :string(255)
# obs_url :string(255)
# obs_url :string(255) default("https://unconfigured.openbuildservice.org")
# cleanup_after_days :integer
# admin_email :string(255) default("unconfigured@openbuildservice.org")
# cleanup_empty_projects :boolean default(TRUE)
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/linked_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def validate_duplicates
# linked_db_project_id :integer indexed => [db_project_id]
# position :integer
# linked_remote_project_name :string(255)
# vrevmode :string(10) default("standard")
# vrevmode :string(8) default("standard")
#
# Indexes
#
Expand Down
14 changes: 6 additions & 8 deletions src/api/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# Do not eager load code on boot.
config.eager_load = false

# see http://guides.rubyonrails.org/action_mailer_basics.html#example-action-mailer-configuration
config.action_mailer.delivery_method = :smtp
# we deliver to mailcatcher https://github.com/sj26/mailcatcher
config.action_mailer.smtp_settings = { address: '127.0.0.1', port: '1025' }
config.action_mailer.raise_delivery_errors = true

# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
Expand All @@ -24,20 +30,12 @@
config.session_store = :mem_cache_store
end

# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false

config.action_mailer.delivery_method = :test

# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log

# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin

config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false

# Do not compress assets
config.assets.compress = false

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ChangeConfigurationObsUrlDefault < ActiveRecord::Migration[5.1]
def change
change_column_default(:configurations, :obs_url, from: NULL, to: 'https://unconfigured.openbuildservice.org')
end
end
5 changes: 3 additions & 2 deletions src/api/db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ CREATE TABLE `configurations` (
`http_proxy` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`no_proxy` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`theme` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`obs_url` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`obs_url` varchar(255) COLLATE utf8_bin DEFAULT 'https://unconfigured.openbuildservice.org',
`cleanup_after_days` int(11) DEFAULT NULL,
`admin_email` varchar(255) COLLATE utf8_bin DEFAULT 'unconfigured@openbuildservice.org',
`cleanup_empty_projects` tinyint(1) DEFAULT '1',
Expand Down Expand Up @@ -1315,6 +1315,7 @@ INSERT INTO `schema_migrations` (version) VALUES
('20171218160607'),
('20171219122451'),
('20180109115548'),
('20180110074142');
('20180110074142'),
('20180221175514');


0 comments on commit ece825e

Please sign in to comment.