From patchwork Thu Mar 26 07:35:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= X-Patchwork-Id: 11459469 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5613781 for ; Thu, 26 Mar 2020 07:35:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3648320772 for ; Thu, 26 Mar 2020 07:35:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X8RisST6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727585AbgCZHfq (ORCPT ); Thu, 26 Mar 2020 03:35:46 -0400 Received: from mail-pg1-f180.google.com ([209.85.215.180]:42665 "EHLO mail-pg1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbgCZHfq (ORCPT ); Thu, 26 Mar 2020 03:35:46 -0400 Received: by mail-pg1-f180.google.com with SMTP id h8so2450461pgs.9 for ; Thu, 26 Mar 2020 00:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TYLvl8XLhzcDeF1F2Nj70uz1LJSTL6eRbWXdV1QZuTc=; b=X8RisST6fgSPNMEgvwrez2IvXKz8A7MjEABu1cFyW4NExHNJSjTwFyupbGnm/57iXx ohCeeFORMPSYvxUTcIei17oxD5rBey1AdcsKAHfsg7SlREZxp2KuRWeE8OP74IAlYvJA gpula6v9CsE0aTZQDpYNC0JWY1RCtW0A7oD+fcy55xVBU+aljYg8GBMhcm7RV0Puudha AooTMId4BXIJQpZnh0U40r0wlmmY1BmK5PfxF7xt5UGg+m1Hgx/ELnWLu3T004qigXTQ /eWQg25LeC7JZyAZXMrgnvXnXIZKa4gy1ltazyaM72RlQKSf4+2ZLgTAempHGNyzLLXH 67uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TYLvl8XLhzcDeF1F2Nj70uz1LJSTL6eRbWXdV1QZuTc=; b=Wne1NRoQRCKMF2hbPg3SRu6PYwZF2qkmcZknIk6DEMAPA8HYlmg/mIgilB5s5mqRq1 RhpVqNB/8ojkGzNmItLI6XTO76KzVDsdwsc/tqCx4ed+wZql8h/4TZY1YsOGqj55pJuF aEHZRs9E1rOvF5m2fbkqfIHA7wXKP71ssUxJNpLZI5s3L+sNz25VnUivB8Zp4DF00KM3 dm+REII7EHLARUkEro7BWBtkPKbZbm+v4HA7Wu445KetzPfnkRbyB/a/5ekWEcOhcwH+ 4XYLw66BlLJXL00FUxsbe2omOlvVUqG6CPerqlmdXzGUEMmacdz50SGjI+Awwf87R3Xa D3Lg== X-Gm-Message-State: ANhLgQ2DTS47w3qWepre6NGSySmZA25Gy3sOPNeLlnJpGSQbhbPSDq89 N+oMc5esVYRJy1B+Oj2WyFGINhgi X-Google-Smtp-Source: ADFU+vs0FqwsXwRyKYY5F2f+QFhMAclbXuAsSQQY9EUWDo0DnbgE3VfHXMSotb6f297Y1dswjibSoQ== X-Received: by 2002:a63:e20a:: with SMTP id q10mr6908202pgh.331.1585208144388; Thu, 26 Mar 2020 00:35:44 -0700 (PDT) Received: from localhost.localdomain ([2402:800:6374:c347:544a:f0cc:8a21:fee3]) by smtp.gmail.com with ESMTPSA id d188sm968049pfa.7.2020.03.26.00.35.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 00:35:43 -0700 (PDT) From: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= To: git@vger.kernel.org Cc: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= Subject: [PATCH 1/3] ci: libify logic for usage and checking CI_USER Date: Thu, 26 Mar 2020 14:35:17 +0700 Message-Id: X-Mailer: git-send-email 2.26.0.rc2.357.g1e1ba0441d In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This part of logic will be reused for alpine docker later. Merge those logic into single chunk since they will be used together. While we're at it, add a comment to tell people run with root inside podman container. Signed-off-by: Đoàn Trần Công Danh --- This patch is viewed better with "git diff --color-moved" ci/lib-docker.sh | 37 +++++++++++++++++++++++++++++++++++++ ci/run-linux32-build.sh | 35 +---------------------------------- 2 files changed, 38 insertions(+), 34 deletions(-) create mode 100644 ci/lib-docker.sh diff --git a/ci/lib-docker.sh b/ci/lib-docker.sh new file mode 100644 index 0000000000..ac155ace54 --- /dev/null +++ b/ci/lib-docker.sh @@ -0,0 +1,37 @@ +# Library of functions shared by all CI scripts run inside docker + +if test $# -ne 1 || test -z "$1" +then + echo >&2 "usage: $0 " + exit 1 +fi + +# If this script runs inside a docker container, then all commands are +# usually executed as root. Consequently, the host user might not be +# able to access the test output files. +# If a non 0 host user id is given, then create a user "ci" with that +# user id to make everything accessible to the host user. +HOST_UID=$1 +if test $HOST_UID -eq 0 +then + # Just in case someone does want to run the test suite as root. + # or podman is used in place of docker + CI_USER=root +else + CI_USER=ci + if test "$(id -u $CI_USER 2>/dev/null)" = $HOST_UID + then + echo "user '$CI_USER' already exists with the requested ID $HOST_UID" + else + useradd -u $HOST_UID $CI_USER + fi + + # Due to a bug the test suite was run as root in the past, so + # a prove state file created back then is only accessible by + # root. Now that bug is fixed, the test suite is run as a + # regular user, but the prove state file coming from Travis + # CI's cache might still be owned by root. + # Make sure that this user has rights to any cached files, + # including an existing prove state file. + test -n "$cache_dir" && chown -R $HOST_UID:$HOST_UID "$cache_dir" +fi diff --git a/ci/run-linux32-build.sh b/ci/run-linux32-build.sh index e3a193adbc..81296cdd19 100755 --- a/ci/run-linux32-build.sh +++ b/ci/run-linux32-build.sh @@ -8,11 +8,7 @@ set -ex -if test $# -ne 1 || test -z "$1" -then - echo >&2 "usage: run-linux32-build.sh " - exit 1 -fi +. "${0%/*}/lib-docker.sh" # Update packages to the latest available versions linux32 --32bit i386 sh -c ' @@ -21,35 +17,6 @@ linux32 --32bit i386 sh -c ' libexpat-dev gettext python >/dev/null ' -# If this script runs inside a docker container, then all commands are -# usually executed as root. Consequently, the host user might not be -# able to access the test output files. -# If a non 0 host user id is given, then create a user "ci" with that -# user id to make everything accessible to the host user. -HOST_UID=$1 -if test $HOST_UID -eq 0 -then - # Just in case someone does want to run the test suite as root. - CI_USER=root -else - CI_USER=ci - if test "$(id -u $CI_USER 2>/dev/null)" = $HOST_UID - then - echo "user '$CI_USER' already exists with the requested ID $HOST_UID" - else - useradd -u $HOST_UID $CI_USER - fi - - # Due to a bug the test suite was run as root in the past, so - # a prove state file created back then is only accessible by - # root. Now that bug is fixed, the test suite is run as a - # regular user, but the prove state file coming from Travis - # CI's cache might still be owned by root. - # Make sure that this user has rights to any cached files, - # including an existing prove state file. - test -n "$cache_dir" && chown -R $HOST_UID:$HOST_UID "$cache_dir" -fi - # Build and test linux32 --32bit i386 su -m -l $CI_USER -c ' set -ex From patchwork Thu Mar 26 07:35:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= X-Patchwork-Id: 11459471 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 079E192A for ; Thu, 26 Mar 2020 07:35:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DBF242078E for ; Thu, 26 Mar 2020 07:35:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dmjSXJI3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727636AbgCZHfs (ORCPT ); Thu, 26 Mar 2020 03:35:48 -0400 Received: from mail-pf1-f173.google.com ([209.85.210.173]:36534 "EHLO mail-pf1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbgCZHfr (ORCPT ); Thu, 26 Mar 2020 03:35:47 -0400 Received: by mail-pf1-f173.google.com with SMTP id i13so2358877pfe.3 for ; Thu, 26 Mar 2020 00:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zDdQ9X5EqB5qJyPwsDerek/uo5jgzzuWWCUHTNiXobs=; b=dmjSXJI3LVU5aZl6YvBbVehzV/Y3BGkZpNYF9uaNqIu46wh9JxkNOx6P6jO7gsSi1e 3HVcIStY9E/rtEVf9xEOWlr6yJ+upIY5+qDHj3Iu729hkaMmId6U0Dj2pLJHHqpQ64t9 jEYjIrFcF/BN8yavZIctS06Xy7dTF9QosVW3dltbTVe4VERTdtp7ondHxIKzbziwKR2D WkRLKzk5zBn7UQ3SVyOPBHKUxFtG8w27niTCNJiF7Q9OmWNYAWp7D1oTSFYNhKUUCs4W FroX7LhoIhXWcihOp4YXF4bAd55UdmlfbQ9QY/0j8TZaCp96HaS1J8h1HS4SQo0DjqGA Tung== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zDdQ9X5EqB5qJyPwsDerek/uo5jgzzuWWCUHTNiXobs=; b=bS4i6L7A8GxgO8NuXbDwaFqqdvHTmrA00yWhIFkr7TQax7OrkAat3CfYaBb18aLyms A2xDtOLKCdjo8Z+L9d5hrxGNh1BY1Nuyx5e6S02HwrE/gshe8XzCOboO7BEu4C8reCcp QByT4Cmg8hrYHI0r13K3jkJRBdVwZSkfn43oO5k4iGk5Un9X7OLM978/+tq+vT0Fm7OR 1d0trbYjOV656uW0Vh8yGJHF0NAJcCdfPeN4MALtOcWRbqM5bo7Mi0Gs12NdkZNah9T1 z61RrpXj+IpuVSdgQ0GaFNwGhJQTMWXSQnsJq/B0J7m/YXRfkiEwdCh+vD63FXTplIiL xhdg== X-Gm-Message-State: ANhLgQ2SQE7MRI7G6wsyHxhjAOd/ULUwn+AcIqC382cljMV9IYtcbIEc MCHdhCzomAaYupGjq/tsYESiioiT X-Google-Smtp-Source: ADFU+vuGU470tjYRzdv3ah58A+LlbhKx9i+a0Uh98mvsvdy5EBQW3Fe5IkH6joOfqKlzJhBUS5NsjQ== X-Received: by 2002:a63:78e:: with SMTP id 136mr6927512pgh.181.1585208145828; Thu, 26 Mar 2020 00:35:45 -0700 (PDT) Received: from localhost.localdomain ([2402:800:6374:c347:544a:f0cc:8a21:fee3]) by smtp.gmail.com with ESMTPSA id d188sm968049pfa.7.2020.03.26.00.35.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 00:35:45 -0700 (PDT) From: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= To: git@vger.kernel.org Cc: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= Subject: [PATCH 2/3] ci: refactor docker runner script Date: Thu, 26 Mar 2020 14:35:18 +0700 Message-Id: <2fada3db3d0c802b45551671dcb75e406e3ed2b6.1585203294.git.congdanhqx@gmail.com> X-Mailer: git-send-email 2.26.0.rc2.357.g1e1ba0441d In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We will support alpine check in docker later in this serie. While we're at it, tell people to run as root in podman. Signed-off-by: Đoàn Trần Công Danh --- .travis.yml | 2 +- azure-pipelines.yml | 4 ++-- ci/{run-linux32-docker.sh => run-docker.sh} | 19 +++++++++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) rename ci/{run-linux32-docker.sh => run-docker.sh} (48%) diff --git a/.travis.yml b/.travis.yml index fc5730b085..32e80e2670 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ matrix: services: - docker before_install: - script: ci/run-linux32-docker.sh + script: ci/run-docker.sh linux32 - env: jobname=StaticAnalysis os: linux compiler: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 675c3a43c9..ef504ff29f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -489,14 +489,14 @@ jobs: test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 res=0 - sudo AGENT_OS="$AGENT_OS" BUILD_BUILDNUMBER="$BUILD_BUILDNUMBER" BUILD_REPOSITORY_URI="$BUILD_REPOSITORY_URI" BUILD_SOURCEBRANCH="$BUILD_SOURCEBRANCH" BUILD_SOURCEVERSION="$BUILD_SOURCEVERSION" SYSTEM_PHASENAME="$SYSTEM_PHASENAME" SYSTEM_TASKDEFINITIONSURI="$SYSTEM_TASKDEFINITIONSURI" SYSTEM_TEAMPROJECT="$SYSTEM_TEAMPROJECT" CC=$CC MAKEFLAGS="$MAKEFLAGS" bash -lxc ci/run-linux32-docker.sh || res=1 + sudo AGENT_OS="$AGENT_OS" BUILD_BUILDNUMBER="$BUILD_BUILDNUMBER" BUILD_REPOSITORY_URI="$BUILD_REPOSITORY_URI" BUILD_SOURCEBRANCH="$BUILD_SOURCEBRANCH" BUILD_SOURCEVERSION="$BUILD_SOURCEVERSION" SYSTEM_PHASENAME="$SYSTEM_PHASENAME" SYSTEM_TASKDEFINITIONSURI="$SYSTEM_TASKDEFINITIONSURI" SYSTEM_TEAMPROJECT="$SYSTEM_TEAMPROJECT" CC=$CC MAKEFLAGS="$MAKEFLAGS" bash -lxc ci/run-docker.sh linux32 || res=1 sudo chmod a+r t/out/TEST-*.xml test ! -d t/failed-test-artifacts || sudo chmod a+r t/failed-test-artifacts test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || res=1 exit $res - displayName: 'ci/run-linux32-docker.sh' + displayName: 'ci/run-docker.sh linux32' env: GITFILESHAREPWD: $(gitfileshare.pwd) - task: PublishTestResults@2 diff --git a/ci/run-linux32-docker.sh b/ci/run-docker.sh similarity index 48% rename from ci/run-linux32-docker.sh rename to ci/run-docker.sh index 751acfcf8a..c8dff9d41a 100755 --- a/ci/run-linux32-docker.sh +++ b/ci/run-docker.sh @@ -1,15 +1,22 @@ #!/bin/sh # -# Download and run Docker image to build and test 32-bit Git +# Download and run Docker image to build and test git # . ${0%/*}/lib.sh -docker pull daald/ubuntu32:xenial +CI_TARGET=${1:-linux32} +case "$CI_TARGET" in +linux32) CI_CONTAINER="daald/ubuntu32:xenial" ;; +*) exit 1 ;; +esac + +docker pull "$CI_CONTAINER" # Use the following command to debug the docker build locally: -# $ docker run -itv "${PWD}:/usr/src/git" --entrypoint /bin/bash daald/ubuntu32:xenial -# root@container:/# /usr/src/git/ci/run-linux32-build.sh +# must be 0 if podman is used in place of docker +# $ docker run -itv "${PWD}:/usr/src/git" --entrypoint /bin/sh "$CI_CONTAINER" +# root@container:/# /usr/src/git/ci/run-$CI_TARGET-build.sh container_cache_dir=/tmp/travis-cache @@ -23,8 +30,8 @@ docker run \ --env cache_dir="$container_cache_dir" \ --volume "${PWD}:/usr/src/git" \ --volume "$cache_dir:$container_cache_dir" \ - daald/ubuntu32:xenial \ - /usr/src/git/ci/run-linux32-build.sh $(id -u $USER) + "$CI_CONTAINER" \ + "/usr/src/git/ci/run-$CI_TARGET-build.sh" $(id -u $USER) check_unignored_build_artifacts From patchwork Thu Mar 26 07:35:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= X-Patchwork-Id: 11459473 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15DFD92A for ; Thu, 26 Mar 2020 07:35:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5FB120772 for ; Thu, 26 Mar 2020 07:35:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lkKJqgVy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727647AbgCZHft (ORCPT ); Thu, 26 Mar 2020 03:35:49 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34483 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727600AbgCZHfs (ORCPT ); Thu, 26 Mar 2020 03:35:48 -0400 Received: by mail-pg1-f196.google.com with SMTP id d37so1951758pgl.1 for ; Thu, 26 Mar 2020 00:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o1d/23CTrwJ5jiQB4tTskeSnDCOiNGYtGkE04AMZBdA=; b=lkKJqgVyhRPB6FSG4xIwebkuHQzN8yzCUeH0TZWdw13nBcCDKzSLMurLdeageZWemW vblXh7p0io6pefwJYX4B+94F5YiA8zL0UKkgyTu6xea4MJ8UTssyMRtOC4SP122ho7pY 7uLfxwEZaB1E1D+zQLL8fjL2BDTdGromH4OA9E28Z9292WEC8lyXjhdeIVEt1a78pKUz BCrw6tBhRP6NwvKzamKNXIx7BVZ2NT2DxutVcElXLIhdcyt98+t8CsBe5zWo+ZNlANot 5X9tfK/xonezbYvXQYGibc9+RdA+uqcza/3/ZBxusNNSmNJs7urbJ+SUc0cNmE8JAqDQ OLBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o1d/23CTrwJ5jiQB4tTskeSnDCOiNGYtGkE04AMZBdA=; b=Mxd51ZJWchw5/Ruuxz9bG/s5GztkBRh7QL3SSvfqL8dbYqCdRHGmDoRvX/mFrGyzWA BQS2whHa/p2ekCJjk6kakDjbxRx6WNWkFiEBQNcB4Zicldp+Xg2s+AX2w/ua4g1Wg+lM jDiU1e2y3UB1hOR/+XXSceCr+iw25VmJVVJZv6s9efdTY87hehja2lxqUnjRITRUSbq3 1sIBstIcw2AT9NceejDda++KrDiSTZ2zu7qqLq0ANKEeLS2T+mkY30D7DtrT88EYd3jO FCNWs5uK5NLodGj7HiUXD39I0MSxOboM2D55e7nrouS1htck90MxYwF+c1o+MYh8d46c aXuw== X-Gm-Message-State: ANhLgQ3DdejzX8d9tSTkOpqJFXwsNjbrt1kLMqBeuMR/52zhdIRzNsx3 VAUysGPaJ19hUUUN71KqUfO95mV9 X-Google-Smtp-Source: ADFU+vtLxax5+ez44HAcR16jescCe+a5LJw88mJh8AHhAa3w66rxn87vRD2NSl7ZEEFRVpP7dSTXdg== X-Received: by 2002:a63:c06:: with SMTP id b6mr7163614pgl.218.1585208147342; Thu, 26 Mar 2020 00:35:47 -0700 (PDT) Received: from localhost.localdomain ([2402:800:6374:c347:544a:f0cc:8a21:fee3]) by smtp.gmail.com with ESMTPSA id d188sm968049pfa.7.2020.03.26.00.35.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 00:35:46 -0700 (PDT) From: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= To: git@vger.kernel.org Cc: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= Subject: [PATCH 3/3] travis: build and test on Linux with musl libc and busybox Date: Thu, 26 Mar 2020 14:35:19 +0700 Message-Id: <7d65bb87a25ab35dbf21d972e10a2c3321cc6761.1585203294.git.congdanhqx@gmail.com> X-Mailer: git-send-email 2.26.0.rc2.357.g1e1ba0441d In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Đoàn Trần Công Danh --- .travis.yml | 8 ++++++++ ci/run-alpine-build.sh | 31 +++++++++++++++++++++++++++++++ ci/run-docker.sh | 1 + 3 files changed, 40 insertions(+) create mode 100755 ci/run-alpine-build.sh diff --git a/.travis.yml b/.travis.yml index 32e80e2670..a2927dd120 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,14 @@ matrix: - docker before_install: script: ci/run-docker.sh linux32 + - env: jobname=linux-musl-busybox + os: linux + compiler: + addons: + services: + - docker + before_install: + script: ci/run-docker.sh alpine - env: jobname=StaticAnalysis os: linux compiler: diff --git a/ci/run-alpine-build.sh b/ci/run-alpine-build.sh new file mode 100755 index 0000000000..c83df536e4 --- /dev/null +++ b/ci/run-alpine-build.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Build and test Git in Alpine Linux +# +# Usage: +# run-alpine-build.sh +# + +set -ex + +useradd () { + adduser -D "$@" +} + +. "${0%/*}/lib-docker.sh" + +# Update packages to the latest available versions +apk add --update autoconf build-base curl-dev openssl-dev expat-dev \ + gettext pcre2-dev python3 musl-libintl >/dev/null + +# Build and test +su -m -l $CI_USER -c ' + set -ex + cd /usr/src/git + test -n "$cache_dir" && ln -s "$cache_dir/.prove" t/.prove + autoconf + echo "PYTHON_PATH=/usr/bin/python3" >config.mak + ./configure --with-libpcre + make + make test +' diff --git a/ci/run-docker.sh b/ci/run-docker.sh index c8dff9d41a..47affcd6d3 100755 --- a/ci/run-docker.sh +++ b/ci/run-docker.sh @@ -8,6 +8,7 @@ CI_TARGET=${1:-linux32} case "$CI_TARGET" in linux32) CI_CONTAINER="daald/ubuntu32:xenial" ;; +alpine) CI_CONTAINER="alpine" ;; *) exit 1 ;; esac