Skip to content

Commit a276d82

Browse files
[ubuntu] split git and git-lfs into separate install scripts (#8711)
for better observability of integrity validation let us split install script into two
1 parent 0226f7b commit a276d82

File tree

6 files changed

+31
-11
lines changed

6 files changed

+31
-11
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash -e
2+
################################################################################
3+
## File: git-lfs.sh
4+
## Desc: Installs Git-lfs
5+
################################################################################
6+
7+
# Source the helpers for use with the script
8+
source $HELPER_SCRIPTS/install.sh
9+
10+
GIT_LFS_REPO="https://packagecloud.io/install/repositories/github/git-lfs"
11+
12+
# Install git-lfs
13+
curl -fsSL $GIT_LFS_REPO/script.deb.sh | bash
14+
apt-get install -y git-lfs
15+
16+
# Remove source repo's
17+
rm /etc/apt/sources.list.d/github_git-lfs.list
18+
19+
# Document apt source repo's
20+
echo "git-lfs $GIT_LFS_REPO" >> $HELPER_SCRIPTS/apt-sources.txt
21+
22+
invoke_tests "Tools" "Git-lfs"

images/linux/scripts/installers/git.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
source $HELPER_SCRIPTS/install.sh
99

1010
GIT_REPO="ppa:git-core/ppa"
11-
GIT_LFS_REPO="https://packagecloud.io/install/repositories/github/git-lfs"
1211

1312
## Install git
1413
add-apt-repository $GIT_REPO -y
@@ -21,20 +20,14 @@ cat <<EOF >> /etc/gitconfig
2120
directory = *
2221
EOF
2322

24-
# Install git-lfs
25-
curl -fsSL $GIT_LFS_REPO/script.deb.sh | bash
26-
apt-get install -y git-lfs
27-
2823
# Install git-ftp
2924
apt-get install git-ftp -y
3025

3126
# Remove source repo's
3227
add-apt-repository --remove $GIT_REPO
33-
rm /etc/apt/sources.list.d/github_git-lfs.list
3428

3529
# Document apt source repo's
3630
echo "git-core $GIT_REPO" >> $HELPER_SCRIPTS/apt-sources.txt
37-
echo "git-lfs $GIT_LFS_REPO" >> $HELPER_SCRIPTS/apt-sources.txt
3831

3932
# Add well-known SSH host keys to known_hosts
4033
ssh-keyscan -t rsa,ecdsa,ed25519 github.com >> /etc/ssh/ssh_known_hosts

images/linux/scripts/tests/Tools.Tests.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,17 @@ Describe "Git" {
241241
"git --version" | Should -ReturnZeroExitCode
242242
}
243243

244-
It "git-lfs" {
245-
"git-lfs --version" | Should -ReturnZeroExitCode
246-
}
247-
248244
It "git-ftp" {
249245
"git-ftp --version" | Should -ReturnZeroExitCode
250246
}
251247
}
252248

249+
Describe "Git-lfs" {
250+
It "git-lfs" {
251+
"git-lfs --version" | Should -ReturnZeroExitCode
252+
}
253+
}
254+
253255
Describe "Heroku" {
254256
It "heroku" {
255257
"heroku --version" | Should -ReturnZeroExitCode

images/linux/ubuntu2004.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@
217217
"{{template_dir}}/scripts/installers/gcc.sh",
218218
"{{template_dir}}/scripts/installers/gfortran.sh",
219219
"{{template_dir}}/scripts/installers/git.sh",
220+
"{{template_dir}}/scripts/installers/git-lfs.sh",
220221
"{{template_dir}}/scripts/installers/github-cli.sh",
221222
"{{template_dir}}/scripts/installers/google-chrome.sh",
222223
"{{template_dir}}/scripts/installers/google-cloud-cli.sh",

images/linux/ubuntu2204.pkr.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ build {
300300
"${path.root}/scripts/installers/gcc.sh",
301301
"${path.root}/scripts/installers/gfortran.sh",
302302
"${path.root}/scripts/installers/git.sh",
303+
"${path.root}/scripts/installers/git-lfs.sh",
303304
"${path.root}/scripts/installers/github-cli.sh",
304305
"${path.root}/scripts/installers/google-chrome.sh",
305306
"${path.root}/scripts/installers/google-cloud-cli.sh",

images/linux/ubuntuminimal.pkr.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ build {
257257
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
258258
scripts = [
259259
"${path.root}/scripts/installers/git.sh",
260+
"${path.root}/scripts/installers/git-lfs.sh",
260261
"${path.root}/scripts/installers/github-cli.sh",
261262
"${path.root}/scripts/installers/zstd.sh"
262263
]

0 commit comments

Comments
 (0)