From 203ee3cbb52e6375876361c897568944446e2bfb Mon Sep 17 00:00:00 2001 From: Sergey Shandar Date: Thu, 25 Apr 2019 14:27:58 -0700 Subject: [PATCH 1/5] branch protection --- preproduction-azure-pipelines.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/preproduction-azure-pipelines.yml b/preproduction-azure-pipelines.yml index 6a0e3a74141f..08ba343d7393 100644 --- a/preproduction-azure-pipelines.yml +++ b/preproduction-azure-pipelines.yml @@ -13,6 +13,12 @@ variables: jobs: +- job: "BranchProtection" + pool: + vmImage: 'Ubuntu 16.04' + condition: and(variables['PRIVATE'], eq(variables['System.PullRequest.TargetBranch'], 'master')) + steps: '>&2 echo "the branch is protected"' + - job: "Syntax" pool: vmImage: 'Ubuntu 16.04' From 65ad3b905c23de094c17b25effb6a86ebd1f7d0d Mon Sep 17 00:00:00 2001 From: Sergey Shandar Date: Thu, 25 Apr 2019 14:31:16 -0700 Subject: [PATCH 2/5] script --- preproduction-azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/preproduction-azure-pipelines.yml b/preproduction-azure-pipelines.yml index 08ba343d7393..25b13353c7c9 100644 --- a/preproduction-azure-pipelines.yml +++ b/preproduction-azure-pipelines.yml @@ -17,7 +17,8 @@ jobs: pool: vmImage: 'Ubuntu 16.04' condition: and(variables['PRIVATE'], eq(variables['System.PullRequest.TargetBranch'], 'master')) - steps: '>&2 echo "the branch is protected"' + steps: + - script: '>&2 echo "the branch is protected"' - job: "Syntax" pool: From dda0a5a25165a535150a56956c700c8aaeed0e63 Mon Sep 17 00:00:00 2001 From: Sergey Shandar Date: Thu, 25 Apr 2019 14:32:35 -0700 Subject: [PATCH 3/5] test --- preproduction-azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preproduction-azure-pipelines.yml b/preproduction-azure-pipelines.yml index 25b13353c7c9..57f843231b1a 100644 --- a/preproduction-azure-pipelines.yml +++ b/preproduction-azure-pipelines.yml @@ -16,7 +16,7 @@ jobs: - job: "BranchProtection" pool: vmImage: 'Ubuntu 16.04' - condition: and(variables['PRIVATE'], eq(variables['System.PullRequest.TargetBranch'], 'master')) + condition: and(not(variables['PRIVATE']), eq(variables['System.PullRequest.TargetBranch'], 'master')) steps: - script: '>&2 echo "the branch is protected"' From 34151130cb0359b0d86bacc601844eb66a672b35 Mon Sep 17 00:00:00 2001 From: Sergey Shandar Date: Thu, 25 Apr 2019 14:40:39 -0700 Subject: [PATCH 4/5] failOnstderr --- preproduction-azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/preproduction-azure-pipelines.yml b/preproduction-azure-pipelines.yml index 57f843231b1a..700b426909b3 100644 --- a/preproduction-azure-pipelines.yml +++ b/preproduction-azure-pipelines.yml @@ -19,6 +19,7 @@ jobs: condition: and(not(variables['PRIVATE']), eq(variables['System.PullRequest.TargetBranch'], 'master')) steps: - script: '>&2 echo "the branch is protected"' + failOnStderr: true - job: "Syntax" pool: From 9d0f2b816e42d5d814eb31dd83d0f61566c042ac Mon Sep 17 00:00:00 2001 From: Sergey Shandar Date: Thu, 25 Apr 2019 14:43:43 -0700 Subject: [PATCH 5/5] on private --- preproduction-azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preproduction-azure-pipelines.yml b/preproduction-azure-pipelines.yml index 700b426909b3..0f888ebbd851 100644 --- a/preproduction-azure-pipelines.yml +++ b/preproduction-azure-pipelines.yml @@ -16,7 +16,7 @@ jobs: - job: "BranchProtection" pool: vmImage: 'Ubuntu 16.04' - condition: and(not(variables['PRIVATE']), eq(variables['System.PullRequest.TargetBranch'], 'master')) + condition: and(variables['PRIVATE'], eq(variables['System.PullRequest.TargetBranch'], 'master')) steps: - script: '>&2 echo "the branch is protected"' failOnStderr: true