-
Notifications
You must be signed in to change notification settings - Fork 472
Expand file tree
/
Copy pathRakefile
More file actions
31 lines (30 loc) · 1.18 KB
/
Rakefile
File metadata and controls
31 lines (30 loc) · 1.18 KB
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
CONTAINER_USERID = %x(id -u).freeze
namespace :docker do
desc 'Build our development environment'
task :build do
# Setup the git commit message template
sh 'git config commit.template .gitmessage'
sh 'touch docker-files/home/.bash_history docker-files/home/.irb_history docker-files/home/.pry_history'
sh "cat << EOF > docker-compose.override.yml
# This file is generated by our Rakefile. Do not change it!
services:
frontend:
build:
args:
CONTAINER_USERID: #{CONTAINER_USERID}
volumes:
- ./docker-files/home/.bash_history:/home/frontend/.bash_history:Z
- ./docker-files/home/.irb_history:/home/frontend/.irb_history:Z
- ./docker-files/home/.pry_history:/home/frontend/.pry_history:Z
- ./docker-files/home/.irbrc:/home/frontend/.irbrc:Z
- ./docker-files/home/.pryrc:/home/frontend/.pryrc:Z
EOF"
# Build the frontend container and pull newer version of the image if available
sh 'docker compose build --pull frontend'
# Bootstrap the app
sh 'docker compose up -d db'
sh 'docker compose run --no-deps --rm frontend bundle exec rake dev:bootstrap RAILS_ENV=development'
ensure
sh 'docker compose stop'
end
end