From 5476acf8dace837f52013dd31f062b787ce9cec7 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Mon, 5 Apr 2021 11:39:16 +0300 Subject: [PATCH 1/6] rework git installation --- images/linux/scripts/installers/git.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/images/linux/scripts/installers/git.sh b/images/linux/scripts/installers/git.sh index e620f68f7706..dd8cbe212d51 100644 --- a/images/linux/scripts/installers/git.sh +++ b/images/linux/scripts/installers/git.sh @@ -8,14 +8,21 @@ source $HELPER_SCRIPTS/install.sh ## Install git -add-apt-repository ppa:git-core/ppa -y -apt-get update -apt-get install git -y +latest_git_version=$(curl -s -L "https://api.github.com/repos/git/git/tags" | jq -r '.[].name' | grep -ve "-.*" | head -1 | tr -d "v") +download_with_retries https://github.com/git/git/archive/v${latest_git_version}.tar.gz "/tmp" "git.tar.gz" +git_installation_path="/usr/local/git" +git_tar_tmp="/tmp/git.tar.gz" +mkdir -p "${git_installation_path}" +tar -zxf "${git_tar_tmp}" -C "${git_installation_path}" +rm -f "${git_tar_tmp}" +cd "${git_installation_path}/git-${latest_git_version}" +make prefix=/usr/local all +make prefix=/usr/local install git --version # Install git-lfs -curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash -apt-get install -y --no-install-recommends git-lfs +apt-get update -y +apt-get install -y git-lfs # Install git-ftp apt-get install git-ftp -y From 77ba59588e8e3c9767be25ab285fb34b825b09bf Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Mon, 5 Apr 2021 11:58:30 +0300 Subject: [PATCH 2/6] simplify git installation --- images/linux/scripts/installers/git.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/images/linux/scripts/installers/git.sh b/images/linux/scripts/installers/git.sh index dd8cbe212d51..a7dcc335f40f 100644 --- a/images/linux/scripts/installers/git.sh +++ b/images/linux/scripts/installers/git.sh @@ -8,16 +8,8 @@ source $HELPER_SCRIPTS/install.sh ## Install git -latest_git_version=$(curl -s -L "https://api.github.com/repos/git/git/tags" | jq -r '.[].name' | grep -ve "-.*" | head -1 | tr -d "v") -download_with_retries https://github.com/git/git/archive/v${latest_git_version}.tar.gz "/tmp" "git.tar.gz" -git_installation_path="/usr/local/git" -git_tar_tmp="/tmp/git.tar.gz" -mkdir -p "${git_installation_path}" -tar -zxf "${git_tar_tmp}" -C "${git_installation_path}" -rm -f "${git_tar_tmp}" -cd "${git_installation_path}/git-${latest_git_version}" -make prefix=/usr/local all -make prefix=/usr/local install +apt-get update +apt-get install git -y git --version # Install git-lfs From 6a3bd2ef0689266dff97864c0e4cd383395fa9c9 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Mon, 5 Apr 2021 13:07:21 +0300 Subject: [PATCH 3/6] minor fix --- images/linux/scripts/installers/git.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/images/linux/scripts/installers/git.sh b/images/linux/scripts/installers/git.sh index a7dcc335f40f..d7040b4cc0ac 100644 --- a/images/linux/scripts/installers/git.sh +++ b/images/linux/scripts/installers/git.sh @@ -13,7 +13,6 @@ apt-get install git -y git --version # Install git-lfs -apt-get update -y apt-get install -y git-lfs # Install git-ftp From 5373056d9fb6bfc577eee1ab23cce646818cff99 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 8 Apr 2021 10:08:56 +0300 Subject: [PATCH 4/6] document source repo's --- .../SoftwareReport/SoftwareReport.Tools.psm1 | 6 ++++-- images/linux/scripts/installers/git.sh | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index deab9dcd7e08..75d6938157c3 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -75,13 +75,15 @@ function Get-DockerBuildxVersion { function Get-GitVersion { $result = Get-CommandResult "git --version" $gitVersion = $result.Output | Take-OutputPart -Part 2 - return "Git $gitVersion" + $aptSourceRepo = Get-AptSourceRepository -PackageName "git" + return "Git $gitVersion (apt source repository: $aptSourceRepo)" } function Get-GitLFSVersion { $result = Get-CommandResult "git-lfs --version" $gitlfsversion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/" - return "Git LFS $gitlfsversion" + $aptSourceRepo = Get-AptSourceRepository -PackageName "git-lfs" + return "Git LFS $gitlfsversion (apt source repository: $aptSourceRepo)" } function Get-GitFTPVersion { diff --git a/images/linux/scripts/installers/git.sh b/images/linux/scripts/installers/git.sh index d7040b4cc0ac..b86dfde67022 100644 --- a/images/linux/scripts/installers/git.sh +++ b/images/linux/scripts/installers/git.sh @@ -7,17 +7,30 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/install.sh +GIT_REPO="ppa:git-core/ppa" +GIT_LFS_REPO="https://packagecloud.io/install/repositories/github/git-lfs" + ## Install git +add-apt-repository $GIT_REPO -y apt-get update apt-get install git -y git --version # Install git-lfs +curl -s $GIT_LFS_REPO/script.deb.sh | bash apt-get install -y git-lfs # Install git-ftp apt-get install git-ftp -y +# Remove source repo's +add-apt-repository --remove $GIT_REPO +rm /etc/apt/sources.list.d/github_git-lfs.list + +# Document apt source repo's +echo "git $GIT_REPO" >> $HELPER_SCRIPTS/apt-sources.txt +echo "git-lfs $GIT_LFS_REPO" >> $HELPER_SCRIPTS/apt-sources.txt + #Install hub tmp_hub="/tmp/hub" mkdir -p "$tmp_hub" From 35664e1b9ade58e5934503604551b38368c11d3c Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 8 Apr 2021 19:24:38 +0300 Subject: [PATCH 5/6] small fix --- images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 2 +- images/linux/scripts/installers/git.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 75d6938157c3..5977095e3f69 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -82,7 +82,7 @@ function Get-GitVersion { function Get-GitLFSVersion { $result = Get-CommandResult "git-lfs --version" $gitlfsversion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/" - $aptSourceRepo = Get-AptSourceRepository -PackageName "git-lfs" + $aptSourceRepo = Get-AptSourceRepository -PackageName "lfs" return "Git LFS $gitlfsversion (apt source repository: $aptSourceRepo)" } diff --git a/images/linux/scripts/installers/git.sh b/images/linux/scripts/installers/git.sh index b86dfde67022..85a3bb73aa15 100644 --- a/images/linux/scripts/installers/git.sh +++ b/images/linux/scripts/installers/git.sh @@ -29,7 +29,7 @@ rm /etc/apt/sources.list.d/github_git-lfs.list # Document apt source repo's echo "git $GIT_REPO" >> $HELPER_SCRIPTS/apt-sources.txt -echo "git-lfs $GIT_LFS_REPO" >> $HELPER_SCRIPTS/apt-sources.txt +echo "lfs $GIT_LFS_REPO" >> $HELPER_SCRIPTS/apt-sources.txt #Install hub tmp_hub="/tmp/hub" From 4a3fddd93d9cebe9f4f4e6bfa83973923ca39cb8 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Fri, 9 Apr 2021 09:50:49 +0300 Subject: [PATCH 6/6] debug --- images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 4 ++-- images/linux/scripts/installers/git.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 3b4fd30a4ca5..c0b5de04cf08 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -78,14 +78,14 @@ function Get-DockerBuildxVersion { function Get-GitVersion { $result = Get-CommandResult "git --version" $gitVersion = $result.Output | Take-OutputPart -Part 2 - $aptSourceRepo = Get-AptSourceRepository -PackageName "git" + $aptSourceRepo = Get-AptSourceRepository -PackageName "git-core" return "Git $gitVersion (apt source repository: $aptSourceRepo)" } function Get-GitLFSVersion { $result = Get-CommandResult "git-lfs --version" $gitlfsversion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/" - $aptSourceRepo = Get-AptSourceRepository -PackageName "lfs" + $aptSourceRepo = Get-AptSourceRepository -PackageName "git-lfs" return "Git LFS $gitlfsversion (apt source repository: $aptSourceRepo)" } diff --git a/images/linux/scripts/installers/git.sh b/images/linux/scripts/installers/git.sh index 85a3bb73aa15..d878862cbc93 100644 --- a/images/linux/scripts/installers/git.sh +++ b/images/linux/scripts/installers/git.sh @@ -28,8 +28,8 @@ add-apt-repository --remove $GIT_REPO rm /etc/apt/sources.list.d/github_git-lfs.list # Document apt source repo's -echo "git $GIT_REPO" >> $HELPER_SCRIPTS/apt-sources.txt -echo "lfs $GIT_LFS_REPO" >> $HELPER_SCRIPTS/apt-sources.txt +echo "git-core $GIT_REPO" >> $HELPER_SCRIPTS/apt-sources.txt +echo "git-lfs $GIT_LFS_REPO" >> $HELPER_SCRIPTS/apt-sources.txt #Install hub tmp_hub="/tmp/hub"