xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Doug Goldstein <cardoe@cardoe.com>, Wei Liu <wei.liu2@citrix.com>
Subject: [Xen-devel] [PATCH] gitlab-ci: allow specifying base and tip in build test
Date: Tue, 16 Apr 2019 08:21:39 +0100	[thread overview]
Message-ID: <20190416072139.490-1-wei.liu2@citrix.com> (raw)
Message-ID: <20190416072139.SIejX129yRawSmBXOnFAJE7TFBjz7QxelIMqwNGtoGk@z> (raw)

We will soon provide this new capability to humans and automated
systems.

The default behaviour is retained: tip and base are passed by Gitlab
CI.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 automation/gitlab-ci/build-each-commit.sh | 10 +++++-----
 automation/gitlab-ci/test.yaml            |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/automation/gitlab-ci/build-each-commit.sh b/automation/gitlab-ci/build-each-commit.sh
index 879028b5a7..19e337b468 100755
--- a/automation/gitlab-ci/build-each-commit.sh
+++ b/automation/gitlab-ci/build-each-commit.sh
@@ -1,18 +1,18 @@
 #!/bin/bash
 
 # For a newly pushed branch the BEFORE_SHA will be all 0s
-if [[ ${CI_COMMIT_BEFORE_SHA} == 0000000000000000000000000000000000000000 ]]; then
+if [[ ${BASE} == 0000000000000000000000000000000000000000 ]]; then
     echo "Newly pushed branch, skipped"
     exit 0
 fi
 
-git merge-base --is-ancestor ${CI_COMMIT_BEFORE_SHA} ${CI_COMMIT_SHA}
+git merge-base --is-ancestor ${BASE} ${TIP}
 if [[ $? -ne 0 ]]; then
-    echo "${CI_COMMIT_SHA} is not a descendent of ${CI_COMMIT_BEFORE_SHA}, skipped"
+    echo "${TIP} is not a descendent of ${BASE}, skipped"
     exit 0
 fi
 
-echo "Building ${CI_COMMIT_BEFORE_SHA}..${CI_COMMIT_SHA}"
+echo "Building ${BASE}..${TIP}"
 
-NON_SYMBOLIC_REF=1 ./automation/scripts/build-test.sh ${CI_COMMIT_BEFORE_SHA} ${CI_COMMIT_SHA} \
+NON_SYMBOLIC_REF=1 ./automation/scripts/build-test.sh ${BASE} ${TIP} \
     bash -c "git clean -ffdx && ./automation/scripts/build"
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index d4556afe11..a795866673 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -7,7 +7,7 @@ build-each-commit-gcc:
     XEN_TARGET_ARCH: x86_64
     CC: gcc
   script:
-    - ./automation/gitlab-ci/build-each-commit.sh 2>&1 | tee build-each-commit-gcc.log
+    - BASE=${BASE_SHA:-${CI_COMMIT_BEFORE_SHA}} TIP=${TIP_SHA:-${CI_COMMIT_SHA}} ./automation/gitlab-ci/build-each-commit.sh 2>&1 | tee build-each-commit-gcc.log
   artifacts:
     paths:
       - '*.log'
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2019-04-16  7:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  7:21 Wei Liu [this message]
2019-04-16  7:21 ` [Xen-devel] [PATCH] gitlab-ci: allow specifying base and tip in build test Wei Liu
2019-05-13 14:17 ` Wei Liu
2019-05-13 14:17   ` [Xen-devel] " Wei Liu
2019-05-14 17:50 ` Doug Goldstein
2019-05-14 17:50   ` [Xen-devel] " Doug Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190416072139.490-1-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).