Sha256: d4fc164fca9e8adc0d4d298c269b0968089ec06f66e1675115ff9bcf830c4bd3
Contents?: true
Size: 1.63 KB
Versions: 22
Compression:
Stored size: 1.63 KB
Contents
-include .env export ifneq (,$(RAILS_ENV)) env:=$(RAILS_ENV) else ifneq (,$(RACK_ENV)) env:=$(RACK_ENV) endif verify-environment: ifndef CONTAINER_PORT @$(error `CONTAINER_PORT` must be defined in environment) endif ifndef env @$(error Either `env`, `RACK_ENV` or `RAILS_ENV` must be defined in environment) endif project_name:=%%REPOSITORY%%_${env} compose_base:=env HOST_UID=$(shell id -u) \ DOCKER_ORGANIZATION=%%ORGANIZATION%% \ DOCKER_REPOSITORY=%%REPOSITORY%%:%%VERSION%% \ docker-compose \ -p ${project_name} \ -f docker-compose.yml compose:=${compose_base} -f docker-compose.production.yml -f docker-compose.override.yml .PHONY: deploy deploy: ifndef manager @$(error Missing `manager` parameter: `make deploy manager=swarm-manager.example.com`) else @tar -cf - . | ssh ${manager} 'cd $$(mktemp -d) ; chmod 0700 . ; cat - | tar -x ; make deploy-stack ; rm -r $$(pwd)' endif .PHONY: deploy-stack deploy-stack: @${compose} config | docker stack deploy --prune --with-registry-auth -c - ${project_name} .PHONY: console service := app command := /bin/bash console: @echo "Creating temporary container..." @${compose} run --rm ${service} ${command} .PHONY: config config: @${compose} config .PHONY: pull pull: @${compose} pull .PHONY: logs logs: service := app logs: ifndef manager @$(error Missing `manager` parameter: `make logs manager=swarm-manager.example.com`) else ssh ${manager} "docker service logs -f ${project_name}_${service}" endif .PHONY: migrate migrate: @${compose} run --rm app bundle exec rake db:migrate .PHONY: compose compose: @echo ${compose}
Version data entries
22 entries across 22 versions & 1 rubygems