Add Git LFS

This commit is contained in:
Winnie Hellmann 2019-12-04 14:46:07 +00:00 committed by Marin Jankovski
parent 2999f2226b
commit d26edd8ddc
4 changed files with 40 additions and 0 deletions

View file

@ -85,6 +85,20 @@ function print_git_args() {
printf -- "--build-arg GIT_DOWNLOAD_SHA256=%s " "$GIT_DOWNLOAD_SHA256"
}
# see https://github.com/git-lfs/git-lfs/releases
function print_lfs_args() {
case "$1" in
2.9)
LFS_VERSION=2.9.1
LFS_DOWNLOAD_SHA256=2a8e60cf51ec45aa0f4332aa0521d60ec75c76e485d13ebaeea915b9d70ea466
;;
*) echo "Unknown Git LFS version $1"; exit 1;
esac
printf -- "--build-arg LFS_VERSION=%s " "$LFS_VERSION"
printf -- "--build-arg LFS_DOWNLOAD_SHA256=%s " "$LFS_DOWNLOAD_SHA256"
}
function print_node_args() {
case "$1" in
8.x) NODE_INSTALL_VERSION=8.16.0 ;;
@ -165,6 +179,7 @@ function parse_arguments() {
chrome) print_chrome_args $version ;;
docker) print_docker_args $version ;;
git) print_git_args $version ;;
lfs) print_lfs_args $version ;;
node) print_node_args $version ;;
yarn) print_yarn_args $version ;;
postgresql) print_postgres_args $version ;;

14
scripts/install-lfs Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
set -xeuo pipefail
IFS=$'\n\t'
mkdir build \
&& curl -fsSL "$LFS_DOWNLOAD_URL" -o git-lfs.tar.gz \
&& echo "$LFS_DOWNLOAD_SHA256 git-lfs.tar.gz" | sha256sum -c - \
&& tar -C build -xzf git-lfs.tar.gz \
&& cd build \
&& cp git-lfs /usr/local/bin/ \
&& cd .. \
&& rm -rf build \
&& rm git-lfs.tar.gz