Closed little9 closed 6 years ago
@bess @no-reply this was fun 👹
@bess @no-reply
I changed this so it's just referencing the variables. I'm not sure about the best way to set them in production. These return the correct values on the server:
GIT_SHA=$(tail -1 /opt/mahonia/revisions.log | awk '{ print substr($4, 1, length($4)-1) }' 2> /dev/null)
GIT_BRANCH=$(tail -1 /opt/mahonia/revisions.log | awk '{ print $2 }' 2> /dev/null)
LAST_DEPLOYED=$(tail -1 /opt/mahonia/revisions.log | awk '{ print $7 }' | date +%Y-%m-%d 2> /dev/null)
this is working in my dev environment (except for my brach names which normally have forward slashes):
GIT_SHA=$(git rev-parse HEAD 2> /dev/null)
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
LAST_DEPLOYED_DEV="Not in deployed environment"
We could put one set of vars in .env.production
and the other in .env.development
I think we should re-add the default settings to the .env
. So:
GIT_SHA=$(git rev-parse HEAD 2> /dev/null)
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
LAST_DEPLOYED_DEV="Not in deployed environment"
It would also be good to get a commit message in before merging this.
Closing in favor of PR 158
Closes #154