Skip to content

Commit

Permalink
Changes required for saas development
Browse files Browse the repository at this point in the history
  • Loading branch information
crohr authored and oliverguenther committed Oct 24, 2024
1 parent f8d6d55 commit 4f1e621
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion bin/setup_dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# Deletes bundled javascript assets and rebuilds them.
# Useful for when your frontend doesn't work (jQuery not defined etc.) for seemingly no reason at all.

NPM_COMMAND="ci"

# allow to speed-up boot by using npm install instead of npm ci
if [ "$1" = "fast" ]; then
NPM_COMMAND="install"
fi

yell() { echo -e "$0: $*" >&2; }
die() { yell "$*"; exit 1; }
try() { eval "$@" || die "\n\nFailed to run '$*', check log/setup_dev.log for more information."; }
Expand All @@ -18,7 +25,7 @@ echo "Removing public assets"
try 'rm -rf public/assets >> log/setup_dev.log'

echo "Installing node_modules ... "
try '(cd frontend && npm ci) >> log/setup_dev.log'
try "(cd frontend && npm $NPM_COMMAND) >> log/setup_dev.log"

echo "Linking plugin modules"
try 'bundle exec rake openproject:plugins:register_frontend >> log/setup_dev.log'
Expand Down
2 changes: 2 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
if ENV["OPENPROJECT_DEV_EXTRA_HOSTS"].present?
config.hosts.push(*ENV["OPENPROJECT_DEV_EXTRA_HOSTS"].split(","))
end

config.hosts.push /\A\w+\.openproject-dev\.com\z/
end

ActiveRecord::Base.logger = ActiveSupport::Logger.new($stdout) unless String(ENV.fetch("SILENCE_SQL_LOGS", nil)).to_bool
2 changes: 1 addition & 1 deletion spec/helpers/frontend_asset_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
RSpec.describe FrontendAssetHelper do
describe "#include_frontend_assets" do
before do
allow(FrontendAssetHelper).to receive(:assets_proxied?).and_return(proxied)
allow(described_class).to receive(:assets_proxied?).and_return(proxied)
end

context "when proxied" do
Expand Down

0 comments on commit 4f1e621

Please sign in to comment.