-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
executable file
·52 lines (34 loc) · 989 Bytes
/
setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -e
echo "Creating required files and directories..."
mkdir -p var/{pids,run,log}
touch var/log/app.log
cat > config/database.yml <<- EOM
defaults: &defaults
host: localhost
encoding: utf8
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
EOM
echo "Installing dependencies..."
nix-shell shell.nix --pure --run '
npm install
echo "Setting up the database..."
rake db:setup
echo "Building the reader..."
gulp build:reader
echo "Building the countdown page..."
gulp build:countdown
echo "Project built!"
'
echo ""
echo "Installing Nix roots..."
nix-instantiate shell.nix --indirect --add-root $(pwd)/.gcroots/shell.drv
echo ""
echo "To make use of the Nix roots, set 'keep-outputs = true' in your Nix config (see: https://nixos.org/nix/manual/#ch-files).\
This will prevent Nix's garbage collector from erasing most of your build files."
echo ""
echo "Build complete! To start a dev shell, run './dev-shell'."