git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] ci/install-dependencies: libify p4 and git-lfs installation

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
Mar 3, 2023, 13:46 UTC
Message-ID
<13137839f39bdcbc56eae9e96894b5ebe4072374.1677850518.git.congdanhqx@gmail.com>
In-Reply-To
<cover.1677850517.git.congdanhqx@gmail.com>

In a later change, we will install git-lfs for CircleCI test environment. Let move those installations out in order to reuse them.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 ci/install-dependencies.sh | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index 4f407530d3..9a32af8968 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -6,16 +6,12 @@
 . ${0%/*}/lib.sh
 
 P4WHENCE=https://cdist2.perforce.com/perforce/r21.2
-LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
+LFSWHENCE=https://github.com/github/git-lfs/releases/download
 UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev
  tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl
  libemail-valid-perl libio-socket-ssl-perl libnet-smtp-ssl-perl"
 
-case "$runs_on_pool" in
-ubuntu-*)
-	sudo apt-get -q update
-	sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
-		$UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE
+_install_linux_p4() {
 	mkdir --parents "$P4_PATH"
 	pushd "$P4_PATH"
 		wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"
@@ -23,12 +19,36 @@ ubuntu-*)
 		chmod u+x p4d
 		chmod u+x p4
 	popd
+}
+
+_install_linux_git_lfs() {
+	local whence fname
+	whence="$1"
+	fname="$2"
 	mkdir --parents "$GIT_LFS_PATH"
 	pushd "$GIT_LFS_PATH"
-		wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
-		tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
-		cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs .
+		wget --quiet "$whence/$fname"
+		tar --extract --gunzip --strip-components=1 --file "$fname"
 	popd
+}
+
+case "$runs_on_pool" in
+ubuntu-*)
+	sudo apt-get -q update
+	sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
+		$UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE
+
+	case "$(uname -m)" in
+	x86_64)
+		_install_linux_p4
+		_install_linux_git_lfs "$LFSWHENCE/v${LINUX_GIT_LFS_VERSION}" \
+			"git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz"
+		;;
+	*)
+		echo "Not supported architecture" >&2
+		exit 1
+		;;
+	esac
 	;;
 macos-*)
 	export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
-- 
2.40.0.rc1.2.gd15644fe02
Previous: Đoàn Trần Công DanhNext: Đoàn Trần Công Danh
Message 3 of 9 in “Add a CI for unsigned char system”
  1. 0/4 Add a CI for unsigned char systemĐoàn Trần Công Danh, Mar 3, 2023
  2. 1/4 ci/lib.sh: remove an useless breakĐoàn Trần Công Danh, Mar 3, 2023
  3. 2/4 ci/install-dependencies: libify p4 and git-lfs installationĐoàn Trần Công Danh, Mar 3, 2023
  4. 3/4 ci/install-dependencies: install git-lfs for arm64 buildĐoàn Trần Công Danh, Mar 3, 2023
  5. 4/4 ci: add arm64 CI environment via CircleCIĐoàn Trần Công Danh, Mar 3, 2023
  6. Đoàn Trần Công DanhMar 3, 2023
  7. Jeff KingMar 9, 2023
  8. Chris TorekMar 9, 2023
  9. Jeff KingMar 9, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.