From 01f594d026c65220e117c29a078a8e15f1334c3f Mon Sep 17 00:00:00 2001 From: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> Date: Tue, 16 May 2023 14:34:16 -0700 Subject: [PATCH] Adding Git binary to core rp image --- .github/workflows/build.yaml | 3 +++ .github/workflows/functional-test.yaml | 2 +- Makefile | 2 +- build/git.mk | 34 ++++++++++++++++++++++++++ deploy/images/appcore-rp/Dockerfile | 1 + 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 build/git.mk diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 865bbc0a7b2..12987def7ec 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -216,6 +216,9 @@ jobs: uses: docker/setup-buildx-action@v2 with: platforms: linux/amd64,linux/arm64,linux/arm/v7 + - name: Build Git binary + run: | + make build-git - name: Push container images (latest) run: | make docker-test-image-build && make docker-test-image-push diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index c4e65bb41cf..35cd6f9c998 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -159,7 +159,7 @@ jobs: :hourglass: Building Radius and pushing container images for functional tests... - name: Build and Push container images run: | - make build && make docker-build && make docker-push + make build && make build-git && make docker-build && make docker-push env: DOCKER_REGISTRY: ${{ env.CACHE_REGISTRY }} DOCKER_TAG_VERSION: ${{ env.REL_VERSION }} diff --git a/Makefile b/Makefile index 2bf0abcaf6e..0dcf6b21a7c 100644 --- a/Makefile +++ b/Makefile @@ -6,4 +6,4 @@ ARROW := \033[34;1m=>\033[0m # order matters for these -include build/help.mk build/version.mk build/build.mk build/util.mk build/generate.mk build/test.mk build/controller.mk build/docker.mk build/recipes.mk build/install.mk build/debug.mk +include build/help.mk build/version.mk build/build.mk build/util.mk build/generate.mk build/test.mk build/controller.mk build/git.mk build/docker.mk build/recipes.mk build/install.mk build/debug.mk diff --git a/build/git.mk b/build/git.mk new file mode 100644 index 00000000000..bb822576372 --- /dev/null +++ b/build/git.mk @@ -0,0 +1,34 @@ +# ------------------------------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------------------------------ + +GIT_BINARY_URL?=https://github.com/git/git/archive/refs/tags/v2.40.1.tar.gz + +# Downloads and builds Git binary +.PHONY: build-git +build-git: + @echo "$(ARROW) Downloading Git dependency - gettext" + wget https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.1.tar.gz -O gettext.tar.gz + tar xzf gettext.tar.gz + rm -f gettext.tar.gz + cd gettext-0.21.1 + make configure && \ + ./configure --prefix=/usr && \ + make && make install + + @echo "$(ARROW) Downloading Git binary" + wget $(GIT_BINARY_URL) -O git.tar.gz + tar xzf git.tar.gz + rm -f git.tar.gz + mkdir -p /tmp/gitbinary + @echo "$(ARROW) Building Git binary" + cd git-2.40.1 && \ + make configure && \ + ./configure --prefix=/tmp/gitbinary && \ + make all doc info && \ + sudo make install install-doc install-html install-info + mkdir -p $(OUT_DIR)/gitbinary + cp /tmp/gitbinary/bin/git $(OUT_DIR)/gitbinary/ + chmod +x $(OUT_DIR)/gitbinary/git + sudo rm -rf /tmp/gitbinary \ No newline at end of file diff --git a/deploy/images/appcore-rp/Dockerfile b/deploy/images/appcore-rp/Dockerfile index 673fffaacb7..06c9bbafe12 100644 --- a/deploy/images/appcore-rp/Dockerfile +++ b/deploy/images/appcore-rp/Dockerfile @@ -7,6 +7,7 @@ ARG TARGETARCH WORKDIR / COPY ./linux_${TARGETARCH:-amd64}/release/appcore-rp / +COPY ./gitbinary/git /usr/local/bin/ USER 65532:65532