* update to node version 16 * Remove canvas compiled node objects * use f35 testing image as builder/base * Update production builder base image to use Fedora 35 I missed this (it's not immediately obvious that there are 2 base images declared in this file, one called builder, one called production, this seems like it could be refactored to lift that out (give it a name, a cmd, and do nothing else) `as base` perhaps, while keeping separate install processes for testing- and pr-/production images. * Add libpq dependency in production We need this (if not the -devel header file, at least the library) to start pg_ext.so I think this might have been working because of the --cache-from options when building in the build container script? * Update .gitpod.dockerfile * Add temporary cleanup for upgrade to bin/setup This has the undesirable effect of requiring a yarn reinstall. It would be better if there were a smart check to confirm the version of the canvas.node file matched the node version or did not (so we only do this as needed, rather than on every setup invocation until this is removed from the code). * Use check-files rather than force when rebuilding canvas Optimal situation would be a `rebuild` command in yarn (I believe npm has this option) to recompile canvas (all that's needed) rather than fetch, install, and build. Co-authored-by: Michael Kohl <me@citizen428.net>
50 lines
1.7 KiB
Ruby
Executable file
50 lines
1.7 KiB
Ruby
Executable file
#!/usr/bin/env ruby
|
|
require "fileutils"
|
|
|
|
# path to your application root.
|
|
APP_ROOT = File.expand_path("..", __dir__)
|
|
|
|
def system!(*args)
|
|
system(*args) || abort("\n== Command #{args} failed ==")
|
|
end
|
|
|
|
FileUtils.chdir APP_ROOT do
|
|
# This script is a way to set up or update your development environment automatically.
|
|
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
|
# Add necessary setup steps to this file.
|
|
|
|
puts "== Installing dependencies =="
|
|
system! "gem install bundler --conservative"
|
|
system! "bundle config --local cache_all true"
|
|
system! "bundle config --local cache_all_platforms true"
|
|
system! "bundle config --local ignore_messages.rpush true"
|
|
system("bundle check") || system!("bundle install")
|
|
|
|
system! "gem list \"^foreman$\" -i --silent || gem install foreman"
|
|
|
|
# TODO: temporary fix for node 16 upgrade, remove after release as this triggers reinstallation
|
|
# of the canvas library (with its extension compiled against the versioned node symbol)
|
|
if File.exist?("node_modules/canvas/")
|
|
FileUtils.rm_rf("node_modules/canvas/")
|
|
# having removed the module ourselves,
|
|
# we need to coerce yarn, or remove the .yarn-integrity file
|
|
system("yarn install --check-files")
|
|
end
|
|
|
|
# Install JavaScript dependencies if using Yarn
|
|
system("bin/yarn")
|
|
|
|
puts "\n== Copying sample files =="
|
|
unless File.exist?("config/database.yml")
|
|
FileUtils.cp "config/database.yml.sample", "config/database.yml"
|
|
end
|
|
|
|
puts "\n== Initializing the application =="
|
|
system! "bin/rails app_initializer:setup forem:setup"
|
|
|
|
puts "\n== Removing old logs and tempfiles =="
|
|
system! "bin/rails log:clear tmp:clear"
|
|
|
|
puts "\n== Restarting application server =="
|
|
system! "bin/rails restart"
|
|
end
|