curationexperts / mahonia

Oregon Health & Science Repository
Apache License 2.0
6 stars 0 forks source link

Add version to footer #154

Closed little9 closed 6 years ago

little9 commented 6 years ago

Closes #154

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 94.118% when pulling a18314d310e3fad31233bc67d58bf43b084a3512 on feature/version-in-footer into 9928b8e0e09ecd8b789c8df87269819aa5d3f0f5 on master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 94.118% when pulling 7136c8b5862e6ae21cee09a6e690c72aacd2c5e7 on feature/version-in-footer into 2131caa976e9cc5c1ea5be1972c1f72a1d3ef39d on master.

little9 commented 6 years ago

@bess @no-reply this was fun 👹

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 94.118% when pulling c30b2278658ee35d5a4b5a90aa68dcb67e5082da on feature/version-in-footer into 2131caa976e9cc5c1ea5be1972c1f72a1d3ef39d on master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 94.118% when pulling b2da82eb017f924e972a86dcfdf0bf9325f0efdf on feature/version-in-footer into 2131caa976e9cc5c1ea5be1972c1f72a1d3ef39d on master.

little9 commented 6 years ago

@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" 
little9 commented 6 years ago

We could put one set of vars in .env.production and the other in .env.development

no-reply commented 6 years ago

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.

bess commented 6 years ago

Closing in favor of PR 158