Skip to content

Commit

Permalink
use an auto generated name when CODER_TEMPLATE_VERSION is not set
Browse files Browse the repository at this point in the history
Let Coder use a random name if the CODER_TEMPLATE_VERSION is an empty string.
  • Loading branch information
matifali authored Feb 25, 2023
1 parent c6d7857 commit d1ba1c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ if [ -z "${CODER_TEMPLATE_DIR}" ]; then
CODER_TEMPLATE_DIR="${CODER_TEMPLATE_NAME}"
fi

coder templates push ${CODER_TEMPLATE_NAME} --directory ./${CODER_TEMPLATE_DIR} --url ${CODER_URL} --name ${CODER_TEMPLATE_VERSION} --yes
# if the CODER_TEMPLATE_VERSION is empty string then let coder use a random name
if [ -z "${CODER_TEMPLATE_VERSION}" ];
then
coder templates push ${CODER_TEMPLATE_NAME} --directory ./${CODER_TEMPLATE_DIR} --url ${CODER_URL} --yes
else
coder templates push ${CODER_TEMPLATE_NAME} --directory ./${CODER_TEMPLATE_DIR} --url ${CODER_URL} --name ${CODER_TEMPLATE_VERSION} --yes
fi

0 comments on commit d1ba1c9

Please sign in to comment.