From 4aa5f6670e071c9961aefd487dca9b97145ccffd Mon Sep 17 00:00:00 2001 From: Cyteen Date: Fri, 17 Nov 2017 16:57:56 +0000 Subject: [PATCH] Add sources.list and install for git-lfs. --- 020_git-lfs.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 020_git-lfs.sh diff --git a/020_git-lfs.sh b/020_git-lfs.sh new file mode 100644 index 0000000..f10d098 --- /dev/null +++ b/020_git-lfs.sh @@ -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