Skip to content

Commit 3679a0f

Browse files
fix: configure daily-ci for 1ES/CFS network-isolated build
- Add image property to pool configuration - Switch to Gradle@4 ADO task for build and test - Add CFS upstream Azure Artifacts feed to build.gradle, settings.gradle - Add feed credentials to gradle.properties - Strip mavenCentral/gradlePluginPortal in pipeline for network isolation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 107743b commit 3679a0f

4 files changed

Lines changed: 52 additions & 12 deletions

File tree

.azure-pipelines/daily-ci-build.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extends:
2121
parameters:
2222
pool:
2323
name: Azure-Pipelines-1ESPT-ExDShared
24+
image: ubuntu-latest
2425
os: linux
2526
sdl:
2627
sourceAnalysisPool:
@@ -42,17 +43,21 @@ extends:
4243
- checkout: self
4344
submodules: recursive
4445

45-
- task: JavaToolInstaller@0
46-
displayName: Set up Java
46+
- script: |
47+
sed -i "/mavenCentral()/d" build.gradle
48+
sed -i "/gradlePluginPortal()/d" settings.gradle
49+
sed -i "/mavenCentral()/d" settings.gradle
50+
displayName: Strip public repos for network-isolated build
51+
52+
- task: Gradle@4
53+
displayName: Build and Test SDK
4754
inputs:
48-
versionSpec: '17'
55+
gradleWrapperFile: 'gradlew'
56+
workingDirectory: '$(Build.SourcesDirectory)'
57+
tasks: 'assemble test'
58+
options: '--no-daemon -PGraphDeveloperExperiencesPublicPassword=$(ARTIFACTS_PAT)'
59+
publishJUnitResults: true
60+
testResultsFiles: '**/TEST-*.xml'
61+
javaHomeOption: 'JDKVersion'
62+
jdkVersionOption: '1.17'
4963
jdkArchitectureOption: 'x64'
50-
jdkSourceOption: 'PreInstalled'
51-
52-
- script: chmod +x gradlew && ./gradlew assemble
53-
displayName: Build SDK
54-
workingDirectory: $(Build.SourcesDirectory)
55-
56-
- script: ./gradlew test
57-
displayName: Run unit tests
58-
workingDirectory: $(Build.SourcesDirectory)

build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ sourceSets {
3232
repositories {
3333
// You can declare any Maven/Ivy/file repository here.
3434
mavenCentral()
35+
maven {
36+
url 'https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1'
37+
name 'GraphDeveloperExperiencesPublic'
38+
credentials(PasswordCredentials)
39+
authentication {
40+
basic(BasicAuthentication)
41+
}
42+
}
3543
}
3644

3745
apply from: "gradle/dependencies.gradle"
@@ -84,6 +92,14 @@ publishing {
8492
name = "ADO"
8593
url = layout.buildDirectory.dir("publishing-repository")
8694
}
95+
maven {
96+
url 'https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1'
97+
name 'GraphDeveloperExperiencesPublic'
98+
credentials(PasswordCredentials)
99+
authentication {
100+
basic(BasicAuthentication)
101+
}
102+
}
87103
}
88104
}
89105

gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ mavenArtifactSuffix =
3939
#enable mavenCentralPublishingEnabled to publish to maven central
4040
mavenCentralSnapshotArtifactSuffix = -SNAPSHOT
4141
mavenCentralPublishingEnabled=true
42+
43+
# Azure Artifacts CFS feed credentials
44+
GraphDeveloperExperiencesPublicUsername=microsoftgraph
45+
GraphDeveloperExperiencesPublicPassword=PERSONAL_ACCESS_TOKEN

settings.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
mavenCentral()
5+
maven {
6+
url 'https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1'
7+
name 'GraphDeveloperExperiencesPublic'
8+
credentials(PasswordCredentials)
9+
authentication {
10+
basic(BasicAuthentication)
11+
}
12+
}
13+
}
14+
}
15+
116
/*
217
* This file was generated by the Gradle 'init' task.
318
*

0 commit comments

Comments
 (0)