Skip to content

Commit

Permalink
Merge pull request brave#8101 from brave/mplesa-ci-pipeline-network-a…
Browse files Browse the repository at this point in the history
…udit-label

added feature to run network audit on demand and disabled sccache on windows
  • Loading branch information
mihaiplesa authored Feb 7, 2020
2 parents a695042 + faad2cb commit b61595d
Showing 1 changed file with 14 additions and 29 deletions.
43 changes: 14 additions & 29 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ pipeline {
}
stage("sccache") {
when {
allOf {
expression { !DISABLE_SCCACHE }
}
expression { !DISABLE_SCCACHE }
}
steps {
script {
Expand Down Expand Up @@ -351,9 +349,7 @@ pipeline {
}
stage("sccache") {
when {
allOf {
expression { !DISABLE_SCCACHE }
}
expression { !DISABLE_SCCACHE }
}
steps {
script {
Expand All @@ -370,6 +366,9 @@ pipeline {
}
}
stage("audit-network") {
when {
expression { RUN_NETWORK_AUDIT }
}
steps {
timeout(time: 4, unit: "MINUTES") {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
Expand Down Expand Up @@ -497,9 +496,7 @@ pipeline {
}
stage("sccache") {
when {
allOf {
expression { !DISABLE_SCCACHE }
}
expression { !DISABLE_SCCACHE }
}
steps {
script {
Expand All @@ -520,6 +517,9 @@ pipeline {
}
}
stage("audit-network") {
when {
expression { RUN_NETWORK_AUDIT }
}
steps {
timeout(time: 4, unit: "MINUTES") {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
Expand Down Expand Up @@ -687,18 +687,6 @@ pipeline {
}
}
}
stage("sccache") {
when {
allOf {
expression { !DISABLE_SCCACHE }
}
}
steps {
script {
sccacheWindows()
}
}
}
stage("build") {
environment {
SIGN_WIDEVINE_CERT = credentials("widevine_brave_prod_cert.der")
Expand All @@ -715,6 +703,9 @@ pipeline {
}
}
stage("audit-network") {
when {
expression { RUN_NETWORK_AUDIT }
}
steps {
timeout(time: 4, unit: "MINUTES") {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
Expand Down Expand Up @@ -837,6 +828,7 @@ def setEnv() {
SKIP_LINUX = bbPrDetails.labels.count { label -> label.name.equalsIgnoreCase("CI/skip-linux") }.equals(1)
SKIP_MACOS = bbPrDetails.labels.count { label -> label.name.equalsIgnoreCase("CI/skip-macos") }.equals(1)
SKIP_WINDOWS = bbPrDetails.labels.count { label -> label.name.equalsIgnoreCase("CI/skip-windows") }.equals(1)
RUN_NETWORK_AUDIT = bbPrDetails.labels.count { label -> label.name.equalsIgnoreCase("CI/run-network-audit") }.equals(1)
env.SLACK_USERNAME = readJSON(text: SLACK_USERNAME_MAP)[bbPrDetails.user.login]
env.BRANCH_PRODUCTIVITY_HOMEPAGE = "https://github.com/brave/brave-browser/pull/${bbPrNumber}"
env.BRANCH_PRODUCTIVITY_NAME = "Brave Browser PR #${bbPrNumber}"
Expand All @@ -856,6 +848,7 @@ def setEnv() {
SKIP_LINUX = SKIP_LINUX || bcPrDetails.labels.count { label -> label.name.equalsIgnoreCase("CI/skip-linux") }.equals(1)
SKIP_MACOS = SKIP_MACOS || bcPrDetails.labels.count { label -> label.name.equalsIgnoreCase("CI/skip-macos") }.equals(1)
SKIP_WINDOWS = SKIP_WINDOWS || bcPrDetails.labels.count { label -> label.name.equalsIgnoreCase("CI/skip-windows") }.equals(1)
RUN_NETWORK_AUDIT = RUN_NETWORK_AUDIT || bcPrDetails.labels.count { label -> label.name.equalsIgnoreCase("CI/run-network-audit") }.equals(1)
env.SLACK_USERNAME = readJSON(text: SLACK_USERNAME_MAP)[bcPrDetails.user.login]
env.BRANCH_PRODUCTIVITY_HOMEPAGE = "https://github.com/brave/brave-core/pull/${bcPrDetails.number}"
env.BRANCH_PRODUCTIVITY_NAME = "Brave Core PR #${bcPrDetails.number}"
Expand Down Expand Up @@ -1024,14 +1017,6 @@ def sccache() {
sh "npm config --userconfig=.npmrc set sccache sccache"
}

def sccacheWindows() {
echo "Enabling sccache"
powershell """
\$ErrorActionPreference = "Stop"
npm config --userconfig=.npmrc set sccache sccache
"""
}

def config() {
sh """
npm config --userconfig=.npmrc set brave_referrals_api_key ${REFERRAL_API_KEY}
Expand Down

0 comments on commit b61595d

Please sign in to comment.