Add sources.list and install for git-lfs.

This commit is contained in:
Cyteen 2017-11-17 16:57:56 +00:00
parent ce8ec35973
commit 4aa5f6670e
1 changed files with 39 additions and 0 deletions

39
020_git-lfs.sh Normal file
View File

@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -x
# Using in combination with bfg to remove large binary files from a git repo and replace them with a pointer to a uri/url
# debianized repo
# git clone https://github.com/git-lfs/git-lfs
dist=$(lsb_release -c | cut -f2)
if [ "$dist" == 'jessie' ]
then
DIST='jessie'
elif [ "$dist" == 'ascii' ]
then
DIST='stretch'
else [ "$dist" == 'ceres' ]
DIST='sid'
fi
OS=debian
DEST=/etc/apt/sources.list-available
LINK=/etc/apt/sources.list.d
cat > ${DEST}/git-lfs.list << EOF
deb https://packagecloud.io/github/git-lfs/${OS}/ ${DIST} main
deb-src https://packagecloud.io/github/git-lfs/${OS}/ ${DIST} main
EOF
ln -sf ${DEST}/git-lfs.list ${LINK}/git-lfs.list
gpg_key_url="https://packagecloud.io/github/git-lfs/gpgkey"
echo -n "Importing packagecloud gpg key... "
# import the gpg key
curl -L "${gpg_key_url}" 2> /dev/null | apt-key add - &>/dev/null
echo "done."
apt-get update
apt-get install -y git-lfs
apt-get -f install -y