Last active
October 24, 2022 21:09
-
-
Save rpoisel/c32033705b2aa8747d1ca5f5442a559a to your computer and use it in GitHub Desktop.
Sharing Variables between GNU Make and the Bash
This file contains 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
file=$(cat env) | |
for line in $file; do | |
export "${line}" | |
done |
This file contains 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
--- | |
version: '3' | |
services: | |
nginx: | |
image: nginx:1.16.0-alpine | |
ports: | |
- "8080:80" |
This file contains 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
COMPOSE_FILE=docker-compose.myproject.yaml | |
DOCKER_CONTEXT=default | |
COMPOSE_PROJECT_NAME=myproject |
This file contains 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
include env | |
export | |
all: | |
@echo $(COMPOSE_FILE) | |
up: | |
docker compose up -d | |
down: | |
docker compose down -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment