Skip to content

Commit

Permalink
add production task on Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Jun 26, 2019
1 parent 2bbbc03 commit a08ceb3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Expand Up @@ -24,17 +24,11 @@

# Ignore master key for decrypting credentials and more.
/config/master.key

/config/app.yml
/config/database.yml
/public/packs
/public/packs-test
/node_modules

.DS_Store
*.swp
/public/packs
/public/packs-test
/node_modules
yarn-debug.log*
.yarn-integrity
8 changes: 8 additions & 0 deletions Makefile
@@ -1,5 +1,6 @@
DEV_APP_COMMAND = docker-compose -f docker-compose.development.yml run --rm app
TEST_APP_COMMAND = docker-compose -f docker-compose.test.yml run --rm test_app
PRODUCTION_APP_COMMAND = docker-compose run --rm app
DOCKER_LOGIN_COMMAND = docker login -u $(DOCKER_USER) -p $(DOCKER_PASS)

dev_run:
Expand Down Expand Up @@ -30,6 +31,13 @@ test_setup:
@$(TEST_APP_COMMAND) yarn
@$(TEST_APP_COMMAND) rails db:setup

production_setup:
@$(PRODUCTION_APP_COMMAND) rails db:setup
@$(PRODUCTION_APP_COMMAND) rails db:seed

production_run:
@docker-compose up -d

build_base:
@docker build - < base.Dockerfile -t blackcandy/base
@$(DOCKER_LOGIN_COMMAND)
Expand Down
12 changes: 12 additions & 0 deletions config/app.yml
@@ -0,0 +1,12 @@
# config/app.yml for rails-settings-cached
defaults: &defaults
media_path: "<%= ENV['MEDIA_PATH'] %>"

development:
<<: *defaults

test:
<<: *defaults

production:
<<: *defaults

0 comments on commit a08ceb3

Please sign in to comment.