have entrypoint kickoff download off texlive images

install script exits without error if auth fails.
This commit is contained in:
Henry Oswald
2018-03-08 15:38:17 +00:00
parent 0c1b699bd5
commit a741a238a8
3 changed files with 15 additions and 1 deletions

13
bin/install_texlive_gce.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
METADATA=http://metadata.google.internal./computeMetadata/v1
SVC_ACCT=$METADATA/instance/service-accounts/default
ACCESS_TOKEN=$(curl -s -H 'Metadata-Flavor: Google' $SVC_ACCT/token | cut -d'"' -f 4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "No acccess token to download texlive-full images from google container, continuing without downloading. This is likely not a google cloud enviroment."
exit 0
fi
docker login -u '_token' -p $ACCESS_TOKEN https://gcr.io
docker pull --all-tags gcr.io/henry-terraform-admin/texlive-full #TODO NEED TO MAKE THIS AN ENV VAR
echo "Finished downloading texlive-full images"