From 01c6c5fc4239b0a7e13192324902d5f2f941b0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonhyung=20Lee/=EC=9D=B4=EC=A4=80=ED=98=95?= <33523965+veritas9872@users.noreply.github.com> Date: Mon, 10 Apr 2023 18:22:16 +0900 Subject: [PATCH] Fix Makefile (#117) * Add the `PROJECT` variable to the .env file configurations and make the Makefile completely hermetic by removing the environment reading option which I previously missed. * Update README.md to show the new `.env` file default configurations. --- Makefile | 3 ++- README.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c15efe6..39e3b2c 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ COMMAND = /bin/zsh # Specify `PROJECT` for the `make` command if this is the case. _PROJECT = "${SERVICE}-${USR}" # The `COMPOSE_PROJECT_NAME` variable must be lowercase. -PROJECT ?= $(shell echo ${_PROJECT} | tr "[:upper:]" "[:lower:]") +PROJECT = $(shell echo ${_PROJECT} | tr "[:upper:]" "[:lower:]") PROJECT_ROOT = /opt/project # Creates a `.env` file in PWD if it does not exist. @@ -45,6 +45,7 @@ GID=${GID}\n$\ UID=${UID}\n$\ GRP=${GRP}\n$\ USR=${USR}\n$\ +PROJECT=${PROJECT}\n$\ SERVICE=${SERVICE}\n$\ COMMAND=${COMMAND}\n$\ HOST_NAME=${SERVICE}\n$\ diff --git a/README.md b/README.md index d7a76f4..bf666ed 100644 --- a/README.md +++ b/README.md @@ -151,8 +151,12 @@ GID=1000 UID=1000 GRP=GROUPNAME USR=USERNAME +PROJECT=train-username # `PROJECT` must be in lowercase. +SERVICE=train +COMMAND=/bin/zsh # Command to execute on starting the container. HOST_NAME=train IMAGE_NAME=cresset:train-USERNAME +PROJECT_ROOT=/opt/project # [[Optional]]: Fill in these configurations manually if the defaults do not suffice.