-
-
Save carlzulauf/b6d738e05ee812d25b0f9e09bee50400 to your computer and use it in GitHub Desktop.
Core .bin files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative "lib.rb" | |
dc "run app #{ARGV.join(' ')}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative "lib.rb" | |
dc "build" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative "lib.rb" | |
dc "run app rails console", RAILS_ENV: "test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative "lib.rb" | |
dc *ARGV |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# docker-compose.override.yml | |
# | |
# This file is used for local development environment configuration. | |
# | |
# It persists container data in named volumes, mounts application code | |
# to reflect edits and changes, and exposes services to the host for | |
# easier access. | |
## | |
version: "2" | |
services: | |
app: | |
build: | |
context: . | |
args: | |
- APP_NAME=${COMPOSE_PROJECT_NAME} | |
- BUNDLER_ARGS=--without production --with development test | |
depends_on: | |
- amqp | |
- cache | |
- pg | |
- redis | |
environment: | |
- RAILS_ENV | |
env_file: | |
- .env | |
ports: | |
- 3000:3000 | |
volumes: | |
- .:/weedmaps | |
amqp: | |
build: docker/amqp | |
# ports: | |
# - 5672:5672 | |
# - 15672:15672 | |
cache: | |
build: docker/cache | |
# ports: | |
# - 11211:11211 | |
redis: | |
build: docker/redis | |
# ports: | |
# - 6379:6379 | |
volumes: | |
- redis_data:/data | |
pg: | |
build: docker/pg | |
environment: | |
- POSTGRES_USER=${DB_USER} | |
- POSTGRES_PASSWORD=${DB_PASS} | |
- POSTGRES_DB=${DB_NAME} | |
# ports: | |
# - 5432:5432 | |
volumes: | |
- pg_data:/var/lib/postgresql/data | |
volumes: | |
pg_data: | |
redis_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def config_files | |
%w( | |
docker-compose.yml | |
.bin/docker-compose.override.yml | |
docker-compose.test.yml | |
) | |
end | |
def dc(*the_rest, **env) | |
files = config_files.map{ |c| "-f #{c}" }.join(" ") | |
cmds = ["docker-compose #{files}", *the_rest] | |
env.each { |k,v| cmds.prepend "#{k}=#{v}" } | |
cmd = cmds.join(" ") | |
puts cmd | |
system cmd | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative "lib.rb" | |
require 'pry' | |
dc "run app rspec", *ARGV.map { |a| a =~ /spec.+\[/ ? "'#{a}'" : a } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative "lib.rb" | |
dc "up -d" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require_relative "lib.rb" | |
dc "down" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment