Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
start adding expiration
  • Loading branch information
wimo7083
wimo7083 committed Oct 5, 2018
commit 8960e38fb905e0d2c2f2d1621dc3e851b06f8066
86 changes: 36 additions & 50 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,12 @@ include Makefile.in
.PHONY: all
all: run

.PHONY: nuke
nuke:
${DOCKER} system prune -a --volumes

.PHONY: minty-fresh
minty-fresh:
${DOCKER_COMPOSE} down --rmi all --volumes

.PHONY: rmi
rmi:
${DOCKER} images -q | xargs docker rmi -f

.PHONY: rmdi
rmdi:
${DOCKER} images -a --filter=dangling=true -q | xargs ${DOCKER} rmi

.PHONY: rm-exited-containers
rm-exited-containers:
${DOCKER} ps -a -q -f status=exited | xargs ${DOCKER} rm -v

.PHONY: fresh-restart
fresh-restart: minty-fresh setup test run

.PHONY: nuke
nuke:
$(DOCKER) system prune -a --volumes

.PHONY:
minty-fresh:
$(DOCKER_COMPOSE) down --rmi all --volumes

.PHONY: rmi
rmi:
$(DOCKER) images -q | xargs docker rmi -f

.PHONY: rmdi
rmdi:
$(DOCKER) images -a --filter=dangling=true -q | xargs $(DOCKER) rmi

.PHONY: rm-exited-containers
rm-exited-containers:
$(DOCKER) ps -a -q -f status=exited | xargs $(DOCKER) rm -v

.PHONY: fresh-restart
fresh-restart: minty-fresh setup test run
.PHONY: setup
setup: build db_create db_migrate

.PHONY: console-sandbox
console-sandbox:
$(DOCKER_COMPOSE) run $(RAILS_CONTAINER) rails console --sandbox
$(DOCKER_COMPOSE) run $(RAILS_CONTAINER) rails console --sandbox

.PHONY: run
run:
Expand All @@ -77,6 +34,13 @@ console:
routes:
$(DOCKER_COMPOSE) run $(RAILS_CONTAINER) rake routes

.PHONY: bundle
bundle:
$(DOCKER_COMPOSE) run $(RAILS_CONTAINER) bash -c 'cd /app && bundle'



#### Database Targets
.PHONY: db_create
db_create:
$(DOCKER_COMPOSE) run $(RAILS_CONTAINER) rake db:create
Expand All @@ -97,6 +61,7 @@ db_rollback:
db_seed:
$(DOCKER_COMPOSE) run $(RAILS_CONTAINER) rake db:seed

#### Tests and Linting
.PHONY: test
test: bg
$(DOCKER_COMPOSE) run operationcode-psql bash -c "while ! psql --host=operationcode-psql --username=postgres -c 'SELECT 1'; do sleep 5; done;"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm starting to feel odd about this.

As this gets bigger it should really be things in their own target, or in a bash script. Large makefiles with lots of distractions are hard to understand. Plus hiding tests behind a very long bash script means I can't pass in parameters to run test groups.

Expand All @@ -111,12 +76,33 @@ rubocop:
rubocop_auto_correct:
$(DOCKER_COMPOSE) run $(RAILS_CONTAINER) rubocop -a --auto-correct

.PHONY: bundle
bundle:
$(DOCKER_COMPOSE) run $(RAILS_CONTAINER) bash -c 'cd /app && bundle'

setup: build db_create db_migrate
#### Cleanup Targets
.PHONY: nuke
nuke:
$(DOCKER) system prune -a --volumes

.PHONY:
Comment thread
apex-omontgomery marked this conversation as resolved.
Outdated
minty-fresh:
$(DOCKER_COMPOSE) down --rmi all --volumes

.PHONY: rmi
rmi:
$(DOCKER) images -q | xargs docker rmi -f

.PHONY: rmdi
rmdi:
$(DOCKER) images -a --filter=dangling=true -q | xargs $(DOCKER) rmi

.PHONY: rm-exited-containers
rm-exited-containers:
$(DOCKER) ps -a -q -f status=exited | xargs $(DOCKER) rm -v

.PHONY: fresh-restart
fresh-restart: minty-fresh setup test run


#### Deployment targets
publish: build
bin/publish

Expand Down
1 change: 1 addition & 0 deletions app/models/job.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class Job < ApplicationRecord

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does having this in the models section of the code base make it clear enough that this is separate from Sidekiq Jobs?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, yes. Though, it might be helpful to rename the background jobs from Job(s) to Worker(s).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you don't want JobJobs?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you mention it, maybe WorkJobber.

acts_as_taggable

scope :is_available, -> { where(is_open: true) }
def self.with_tags(*args)
tagged_with(args, any: true)
end
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20180531004341) do
ActiveRecord::Schema.define(version: 20180711212702) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down