-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Makefile
60 lines (53 loc) · 2.35 KB
/
Makefile
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
53
54
55
56
57
58
59
60
build:
cp config/database.yml.example config/database.yml
cp db/schema.rb.example db/schema.rb
docker-compose down --remove-orphans
docker-compose build
redeploy-container:
docker-compose build --pull
docker-compose run --rm web yarn install --frozen-lockfile
docker-compose run --rm web bash -c "bundle exec rake db:migrate && bundle exec rake assets:precompile && bundle exec rake tmp:cache:clear"
docker-compose down --remove-orphans
docker-compose up -d
docker-compose exec -T web bash -c "echo 172.17.0.1 smtp >> /etc/hosts"
docker-compose exec -T mailman bash -c "echo 172.17.0.1 smtp >> /etc/hosts"
docker-compose exec -T sidekiq bash -c "echo 172.17.0.1 smtp >> /etc/hosts"
docker-compose exec -T web bundle exec whenever --update-crontab
docker-compose exec -T web service cron start
pull-from-stable:
git pull --ff-only origin stable
automated-redeploy: pull-from-stable redeploy-container
deploy-container:
docker-compose run --rm web yarn install --frozen-lockfile
docker-compose run --rm web bash -c "sleep 5 && bundle exec rails g react:install"
docker-compose run --rm web bash -c "sleep 5 && bundle exec rake db:migrate && bundle exec rake assets:precompile"
docker-compose up -d
docker-compose exec -T web bash -c "echo 172.17.0.1 smtp >> /etc/hosts"
docker-compose exec -T mailman bash -c "echo 172.17.0.1 smtp >> /etc/hosts"
docker-compose exec -T sidekiq bash -c "echo 172.17.0.1 smtp >> /etc/hosts"
docker-compose exec -T web bundle exec whenever --update-crontab
docker-compose exec -T web service cron start
test-container:
docker-compose up -d
docker-compose exec -T web bundle exec rake db:setup
docker-compose exec -T web bundle exec rake db:migrate
docker-compose exec -T web bundle exec yarn install --frozen-lockfile
docker-compose exec -T web bundle exec rake assets:precompile
docker-compose exec -T web bundle exec rake test:all
docker-compose exec -T web rails test -d
docker-compose down
install-dev:
echo "Installing RubyGems"
bundle install --without production mysql
echo "Installing yarn Packages"
yarn install --frozen-lockfile
echo "Copying example configuartions"
cp db/schema.rb.example db/schema.rb
cp config/database.yml.sqlite.example config/database.yml
echo "Setting up the database"
rake db:setup
setup-complete:
echo "Installing Ruby"
rvm install ruby-2.4.4
echo "Installing Bundler"
gem install bundler