diff mbox series

[v2,05/13] ci/lib.sh: add support for Azure Pipelines

Message ID 486d1d25183fc7b0de599a0791ed41a87cc176cb.1539598316.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Offer to run CI/PR builds in Azure Pipelines | expand

Commit Message

Linus Arver via GitGitGadget Oct. 15, 2018, 10:12 a.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

This patch introduces a conditional arm that defines some environment
variables and a function that displays the URL given the job id (to
identify previous runs for known-good trees).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 ci/lib.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

SZEDER Gábor Oct. 16, 2018, 9:43 a.m. UTC | #1
On Mon, Oct 15, 2018 at 03:12:05AM -0700, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> This patch introduces a conditional arm that defines some environment
> variables and a function that displays the URL given the job id (to
> identify previous runs for known-good trees).
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  ci/lib.sh | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/ci/lib.sh b/ci/lib.sh
> index 8532555b4e..584abcd529 100755
> --- a/ci/lib.sh
> +++ b/ci/lib.sh
> @@ -19,6 +19,29 @@ then
>  	BREW_INSTALL_PACKAGES="git-lfs gettext"

So we install these two additional packages in the macOS build jobs on
Travis CI ...

>  	export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
>  	export GIT_TEST_OPTS="--verbose-log -x --immediate"
> +elif test -n "$SYSTEM_TASKDEFINITIONSURI"
> +then
> +	# We are running in Azure Pipelines
> +	CI_BRANCH="$BUILD_SOURCEBRANCH"
> +	CI_COMMIT="$BUILD_SOURCEVERSION"
> +	CI_JOB_ID="$BUILD_BUILDID"
> +	CI_JOB_NUMBER="$BUILD_BUILDNUMBER"
> +	CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)"
> +	test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx
> +	CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')"
> +	CC="${CC:-gcc}"
> +
> +	# use a subdirectory of the cache dir (because the file share is shared
> +	# among *all* phases)
> +	cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME"
> +
> +	url_for_job_id () {
> +		echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1"
> +	}
> +
> +	BREW_INSTALL_PACKAGES=

... but not on Azure Pipelines.  Is this mere oversight or
intentional?  If it's intentional, then I think the commit message
should mention why.

> +	export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
> +	export GIT_TEST_OPTS="--quiet --write-junit-xml"
>  fi
>  
>  skip_branch_tip_with_tag () {
> -- 
> gitgitgadget
>
Johannes Schindelin Oct. 16, 2018, 12:53 p.m. UTC | #2
Hi Gábor,

On Tue, 16 Oct 2018, SZEDER Gábor wrote:

> On Mon, Oct 15, 2018 at 03:12:05AM -0700, Johannes Schindelin via GitGitGadget wrote:
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> > 
> > This patch introduces a conditional arm that defines some environment
> > variables and a function that displays the URL given the job id (to
> > identify previous runs for known-good trees).
> > 
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >  ci/lib.sh | 23 +++++++++++++++++++++++
> >  1 file changed, 23 insertions(+)
> > 
> > diff --git a/ci/lib.sh b/ci/lib.sh
> > index 8532555b4e..584abcd529 100755
> > --- a/ci/lib.sh
> > +++ b/ci/lib.sh
> > @@ -19,6 +19,29 @@ then
> >  	BREW_INSTALL_PACKAGES="git-lfs gettext"
> 
> So we install these two additional packages in the macOS build jobs on
> Travis CI ...
> 
> >  	export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
> >  	export GIT_TEST_OPTS="--verbose-log -x --immediate"
> > +elif test -n "$SYSTEM_TASKDEFINITIONSURI"
> > +then
> > +	# We are running in Azure Pipelines
> > +	CI_BRANCH="$BUILD_SOURCEBRANCH"
> > +	CI_COMMIT="$BUILD_SOURCEVERSION"
> > +	CI_JOB_ID="$BUILD_BUILDID"
> > +	CI_JOB_NUMBER="$BUILD_BUILDNUMBER"
> > +	CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)"
> > +	test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx
> > +	CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')"
> > +	CC="${CC:-gcc}"
> > +
> > +	# use a subdirectory of the cache dir (because the file share is shared
> > +	# among *all* phases)
> > +	cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME"
> > +
> > +	url_for_job_id () {
> > +		echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1"
> > +	}
> > +
> > +	BREW_INSTALL_PACKAGES=
> 
> ... but not on Azure Pipelines.  Is this mere oversight or
> intentional?  If it's intentional, then I think the commit message
> should mention why.

Both packages are already available on Azure Pipelines' VMs. I will
mention this in the commit message.

Thanks,
Dscho

> 
> > +	export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
> > +	export GIT_TEST_OPTS="--quiet --write-junit-xml"
> >  fi
> >  
> >  skip_branch_tip_with_tag () {
> > -- 
> > gitgitgadget
> > 
>
diff mbox series

Patch

diff --git a/ci/lib.sh b/ci/lib.sh
index 8532555b4e..584abcd529 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -19,6 +19,29 @@  then
 	BREW_INSTALL_PACKAGES="git-lfs gettext"
 	export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
 	export GIT_TEST_OPTS="--verbose-log -x --immediate"
+elif test -n "$SYSTEM_TASKDEFINITIONSURI"
+then
+	# We are running in Azure Pipelines
+	CI_BRANCH="$BUILD_SOURCEBRANCH"
+	CI_COMMIT="$BUILD_SOURCEVERSION"
+	CI_JOB_ID="$BUILD_BUILDID"
+	CI_JOB_NUMBER="$BUILD_BUILDNUMBER"
+	CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)"
+	test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx
+	CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')"
+	CC="${CC:-gcc}"
+
+	# use a subdirectory of the cache dir (because the file share is shared
+	# among *all* phases)
+	cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME"
+
+	url_for_job_id () {
+		echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1"
+	}
+
+	BREW_INSTALL_PACKAGES=
+	export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
+	export GIT_TEST_OPTS="--quiet --write-junit-xml"
 fi
 
 skip_branch_tip_with_tag () {