Initial commit

This commit is contained in:
2023-01-27 22:55:09 +11:00
commit 833f3ea8b2
130 changed files with 5637 additions and 0 deletions

38
script/bootstrap Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/sh
# script/bootstrap: Resolve all dependencies that the application requires to
# run.
set -e
cd "$(dirname "$0")/.."
if [ "$1" = "docker" ]; then
docker-compose run --rm app "bundle"
docker-compose run --rm --entrypoint "/bin/sh -lc" assets "npm install"
else
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
}
fi
if [ -f ".tool-versions" ] && [ "$(uname -s)" = "Darwin" ]; then
echo "==> Installing package versions…"
brew bootstrap-asdf
fi
if [ -f "Gemfile" ]; then
echo "==> Installing gem dependencies…"
bundle check >/dev/null 2>&1 || {
bundle config set without 'production'
bundle install --quiet
}
fi
if [ -f "package.json" ]; then
echo "==> Installing node packages…"
npm install
fi
fi

9
script/frontend Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
# script/frontend: Launch the frontend asset server locally.
set -e
cd "$(dirname "$0")/../slices/main/assets/rental"
yarn run dev

5
script/puma Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
set -e
bundle exec puma -C config/puma.rb

19
script/server Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
# script/server: Launch the application and any extra required processes
# locally.
set -e
cd "$(dirname "$0")/.."
test -z "$HANAMI_ENV" && HANAMI_ENV='development'
if ! command -v overmind > /dev/null; then
echo "You must install Overmind to use this script. See:"
echo " . https://github.com/DarthSim/overmind#installation"
exit 1
fi
# Boot the app and any other necessary processes
exec env OVERMIND_PORT=5001 overmind start -f Procfile.dev

25
script/setup Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
# script/setup: Set up application for the first time after cloning, or set it
# back to the initial first unused state.
set -e
if [ ! -f ".env" ]; then
echo "==> Creating .env file"
cp .env-example .env
fi
if [ "$1" == "docker" ]; then
script/bootstrap docker
docker-compose up
else
cd "$(dirname "$0")/.."
script/bootstrap
echo "==> Setting up database..."
bin/hanami db setup
echo "==> App is now ready to go!"
fi

9
script/support Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
# script/support: Launch supporting services for the application.
set -e
cd "$(dirname "$0")/.."
overmind start -f Procfile.support -s .overmind.support.sock

19
script/test Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
# script/test: Run test suite for application. Optionally pass in a path to an
# individual test file to run a single test.
set -e
cd "$(dirname "$0")/.."
[ -z "$DEBUG" ] || set -x
echo "==> Running tests…"
if [ -n "$1" ]; then
# Pass arguments to test call. This is useful for calling a single test.
bundle exec rspec "$1"
else
bundle exec rake spec
fi

17
script/update Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
# script/update: Update application to run for its current checkout.
set -e
cd "$(dirname "$0")/.."
script/bootstrap
echo "==> Updating db…"
bin/hanami db create
bin/hanami db create -e test
bin/hanami db reset -e test
bin/hanami db migrate