Skip to content

Commit f43564d

Browse files
authored
Onboard .NET Docker Bot to secret manager (#1405)
1 parent 1efc63a commit f43564d

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

.config/dotnet-tools.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"microsoft.dnceng.secretmanager": {
6+
"version": "1.1.0-beta.24413.3",
7+
"commands": [
8+
"secret-manager"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.vault-config/secrets.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Partially copied from https://github.com/dotnet/arcade/blob/dfc6882da43decb37f12e0d9011ce82b25225578/.vault-config/product-builds-dnceng-pipeline-secrets.yaml
2+
3+
storageLocation:
4+
type: azure-key-vault
5+
parameters:
6+
name: DotnetDockerKeyVault
7+
subscription: 941d4baa-5ef2-462e-b4b1-505791294610
8+
9+
secrets:
10+
BotAccount-dotnet-docker-bot:
11+
type: github-account
12+
parameters:
13+
Name: dotnet-docker-bot
14+
15+
BotAccount-dotnet-docker-bot-PAT:
16+
type: github-access-token
17+
parameters:
18+
gitHubBotAccountSecret: BotAccount-dotnet-docker-bot
19+
gitHubBotAccountName: dotnet-docker-bot
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
trigger: none
2+
3+
schedules:
4+
- cron: 0 12 * * 0
5+
displayName: Weekly Sunday build
6+
branches:
7+
include:
8+
- main
9+
always: true
10+
11+
stages:
12+
- stage: SynchronizeSecrets
13+
jobs:
14+
- job: Synchronize
15+
displayName: Synchronize secrets
16+
pool:
17+
name: NetCore1ESPool-Internal
18+
demands: ImageOverride -equals 1es-windows-2019
19+
20+
steps:
21+
- task: UseDotNet@2
22+
displayName: Install .NET 8.0 SDK
23+
inputs:
24+
packageType: sdk
25+
version: 8.0.x
26+
installationPath: '$(Build.Repository.LocalPath)/.dotnet'
27+
28+
- task: UseDotNet@2
29+
displayName: Install .NET 6.0 runtime
30+
inputs:
31+
packageType: runtime
32+
version: 6.0.x
33+
installationPath: '$(Build.Repository.LocalPath)/.dotnet'
34+
35+
- powershell: .dotnet/dotnet tool restore --tool-manifest .config/dotnet-tools.json
36+
workingDirectory: $(Build.Repository.LocalPath)
37+
displayName: Restore secret-manager
38+
39+
- task: AzureCLI@2
40+
inputs:
41+
azureSubscription: DotNet Eng Services Secret Manager
42+
scriptType: pscore
43+
scriptLocation: inlineScript
44+
inlineScript: |
45+
Get-ChildItem .vault-config/*.yaml |% { .dotnet/dotnet secret-manager synchronize $_}
46+
workingDirectory: $(Build.Repository.LocalPath)
47+
displayName: Run secret-manager synchronize

0 commit comments

Comments
 (0)