Last active
February 7, 2020 19:01
-
-
Save valdergallo/1a0890e0a5ce42d4a1de14c889ad62f1 to your computer and use it in GitHub Desktop.
Makefile to build images with Docker Composer
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
.PHONY: build | |
APP_VERSION := $$(version show) | |
DOCKER_IMAGE := 134194528133.dkr.ecr.us-west-1.amazonaws.com/ | |
# Make content for developer | |
help: | |
@echo "Create docker images for VPCs" | |
@echo "dev Build for dev" | |
@echo "qas Build for qas" | |
@echo "prod Build for prod" | |
@echo "version Show version" | |
BUILDER: export DOCKER_IMAGE_PATH=${DOCKER_IMAGE} | |
BUILDER: | |
echo "$(APP_VERSION)" > version.txt | |
docker-compose -f ./deploy/docker-compose.yml build --compress | |
PUSHER: | |
docker tag ${DOCKER_IMAGE}:${ENVIRONMENT} ${DOCKER_IMAGE}:${ENVIRONMENT}$(APP_VERSION) | |
docker push ${DOCKER_IMAGE}:${ENVIRONMENT}$(APP_VERSION) | |
docker push ${DOCKER_IMAGE}:${ENVIRONMENT} | |
dev: export ENVIRONMENT=dev | |
dev: BUILDER PUSHER | |
qas: export ENVIRONMENT=qas | |
qas: BUILDER PUSHER | |
prod: export ENVIRONMENT=prod | |
prod: BUILDER PUSHER | |
version: | |
echo $(APP_VERSION) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment