Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions src/usr/local/buildpack/tools/git-lfs.sh

This file was deleted.

39 changes: 39 additions & 0 deletions src/usr/local/buildpack/tools/v2/git-lfs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

function check_tool_requirements () {
check_semver "$TOOL_VERSION" "all"
}

function install_tool () {
local versioned_tool_path
local file
local arch=linux-amd64
local lfs_file="${TOOL_NAME}-${arch}-v${TOOL_VERSION}.tar.gz"
local strip=0

versioned_tool_path=$(create_versioned_tool_path)

# v3.2+ has a subdir https://github.com/git-lfs/git-lfs/pull/4980
if [[ ${MAJOR} -gt 3 || (${MAJOR} -eq 3 && ${MINOR} -ge 2) ]]; then
strip=1
fi

file=$(get_from_url "https://github.com/${TOOL_NAME}/${TOOL_NAME}/releases/download/v${TOOL_VERSION}/${lfs_file}")
temp_dir="$(mktemp -d)"
bsdtar --strip $strip -C "${temp_dir}" -xf "${file}"
mkdir "${versioned_tool_path}/bin"
mv "${temp_dir}/git-lfs" "${versioned_tool_path}/bin/"
rm -rf "${temp_dir}"
}

function link_tool () {
shell_wrapper "${TOOL_NAME}" "$(find_versioned_tool_path)/bin"

git lfs version

if [ "$(is_root)" -eq 0 ]; then
git lfs install --system
else
git lfs install
fi
}
4 changes: 4 additions & 0 deletions test/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ RUN mkdir $HOME/.tf-cache && TF_PLUGIN_CACHE_DIR=$HOME/.tf-cache terraform init
#--------------------------------------
FROM build as testh

RUN prepare-tool docker

USER 1000

ARG APT_HTTP_PROXY

ARG IGNORED_TOOLS=powershell,node
Expand Down