Skip to content

Commit 8234341

Browse files
authored
Merge branch 'dev' into property-tracker
2 parents 5a33c66 + 3cf23b5 commit 8234341

File tree

4 files changed

+104
-17
lines changed

4 files changed

+104
-17
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,19 @@ variables:
2727
BuildAgent: ${{ parameters.BuildAgent }}
2828
GitUserEmail: "GraphTooling@service.microsoft.com"
2929
GitUserName: "Microsoft Graph DevX Tooling"
30+
REGISTRY: 'msgraphprodregistry.azurecr.io'
31+
IMAGE_NAME: 'public/microsoftgraph/powershell'
32+
PREVIEW_BRANCH: 'refs/heads/main' # Updated to target your branch
3033

3134
trigger:
3235
branches:
3336
include:
3437
- main
3538
- dev
39+
tags:
40+
include:
41+
- v*
42+
3643
pr:
3744
branches:
3845
include:
@@ -156,7 +163,79 @@ extends:
156163
nuGetFeedType: external
157164
publishFeedCredentials: 'microsoftgraph PowerShell Gallery connection'
158165

166+
- stage: PushDockerImageToRegistry
167+
condition: and(or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])), not(contains(variables['Build.SourceBranch'], '-preview')))
168+
dependsOn: []
169+
displayName: 'Push docker image'
170+
jobs:
171+
- job: PushDockerImage
172+
displayName: 'Push docker image'
173+
pool:
174+
name: Azure-Pipelines-1ESPT-ExDShared
175+
image: ubuntu-latest
176+
os: linux
177+
steps:
178+
- checkout: self
179+
180+
# Display the contents of the Build.SourcesDirectory
181+
- bash: |
182+
echo "Build.SourcesDirectory: $(Build.SourcesDirectory)"
183+
ls -la $(Build.SourcesDirectory)
184+
displayName: 'List contents of Build.SourcesDirectory'
159185
186+
- task: AzureCLI@2
187+
displayName: "Log in to Azure Container Registry"
188+
inputs:
189+
azureSubscription: 'ACR Images Push Service Connection' # service connection
190+
scriptType: 'bash'
191+
scriptLocation: 'inlineScript'
192+
'inlineScript': |
193+
az acr login --name $(REGISTRY)
194+
- powershell: |
195+
$date = Get-Date -Format "yyyyMMdd"
196+
Write-Host "##vso[task.setvariable variable=currentDate]$date"
197+
198+
- script: |
199+
docker run --privileged --rm tonistiigi/binfmt --install all
200+
displayName: 'Enable multi-platform builds'
201+
202+
- script: |
203+
docker buildx create --use --name mybuilder
204+
displayName: 'Set up Docker BuildX'
205+
206+
- powershell: |
207+
$version = $Env:BUILD_SOURCEBRANCH.replace("refs/tags/", "")
208+
Write-Output "##vso[task.setvariable variable=version]$version"
209+
displayName: 'Get truncated run number'
210+
211+
- bash: |
212+
echo "Build Number: $(Build.BuildNumber)"
213+
# Extract the last 3 characters for the run number
214+
runnumber=$(echo "$(Build.BuildNumber)" | grep -o '[0-9]\+$')
215+
echo "Extracted Run Number: $runnumber"
216+
217+
# If extraction fails, set a default
218+
if [ -z "$runnumber" ]; then
219+
echo "Extraction failed, using default value"
220+
runnumber=$(date +"%S%N" | cut -c1-3)
221+
echo "Generated fallback run number: $runnumber"
222+
fi
223+
224+
# Set the variable for later steps
225+
echo "##vso[task.setvariable variable=RUNNUMBER]$runnumber"
226+
echo "##vso[task.setvariable variable=RUNNUMBER;isOutput=true]$runnumber"
227+
displayName: 'Get truncated run number'
228+
name: getrunnumber
229+
230+
- bash: |
231+
echo "Building docker images"
232+
# Format the date to be compatible with Docker tags
233+
formatted_date=$(date +"%Y%m%d%H%M%S")
234+
docker buildx build \
235+
--platform linux/amd64 \
236+
--push \
237+
-t "$(REGISTRY)/$(IMAGE_NAME):latest" \
238+
-t "$(REGISTRY)/$(IMAGE_NAME):$formatted_date.$RUNNUMBER" \
239+
"$(Build.SourcesDirectory)"
240+
displayName: 'Build and push docker images'
160241
161-
162-
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
### Example
2-
3-
```powershell
4-
5-
Import-Module Microsoft.Graph.Beta.Applications
6-
7-
Get-MgBetaServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId
8-
9-
```
10-
This example shows how to use the Get-MgBetaServicePrincipalSynchronizationTemplate Cmdlet.
11-

src/Security/beta/examples/Add-MgBetaSecurityCaseEdiscoveryCaseReviewSetToReviewSet.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Example 1: Code snippet
1+
### Example 1: Add search with linked files and the latest cloud attachment version
22

33
```powershell
44
@@ -10,11 +10,30 @@ $params = @{
1010
}
1111
additionalDataOptions = "linkedFiles"
1212
cloudAttachmentVersion = "latest"
13+
}
14+
15+
Add-MgBetaSecurityCaseEdiscoveryCaseReviewSetToReviewSet -EdiscoveryCaseId $ediscoveryCaseId -EdiscoveryReviewSetId $ediscoveryReviewSetId -BodyParameter $params
16+
17+
```
18+
This example will add search with linked files and the latest cloud attachment version
19+
20+
### Example 2: Add search with all data options and the latest cloud and document versions
21+
22+
```powershell
23+
24+
Import-Module Microsoft.Graph.Beta.Security
25+
26+
$params = @{
27+
search = @{
28+
id = "c17e91d6-6bc0-4ecb-b388-269ea3d4ffb7"
29+
}
30+
additionalDataOptions = "linkedFiles, allVersions, advancedIndexing, listAttachments, htmlTranscripts, messageConversationExpansion, locationsWithoutHits, allItemsInFolder"
31+
cloudAttachmentVersion = "latest"
1332
documentVersion = "recent10"
1433
}
1534
1635
Add-MgBetaSecurityCaseEdiscoveryCaseReviewSetToReviewSet -EdiscoveryCaseId $ediscoveryCaseId -EdiscoveryReviewSetId $ediscoveryReviewSetId -BodyParameter $params
1736
1837
```
19-
This example shows how to use the Add-MgBetaSecurityCaseEdiscoveryCaseReviewSetToReviewSet Cmdlet.
38+
This example will add search with all data options and the latest cloud and document versions
2039

src/Security/beta/examples/Export-MgBetaSecurityCaseEdiscoveryCaseReviewSet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Import-Module Microsoft.Graph.Beta.Security
77
$params = @{
88
outputName = "Export via API"
99
description = "Export for the Contoso investigation"
10-
exportOptions = "originalFiles,fileInfo,tags"
11-
exportStructure = "directory"
10+
exportOptions = "originalFiles, tags, splitSource, includeFolderAndPath, friendlyName, condensePaths, optimizedPartitionSize"
11+
exportStructure = "msg"
1212
}
1313
1414
Export-MgBetaSecurityCaseEdiscoveryCaseReviewSet -EdiscoveryCaseId $ediscoveryCaseId -EdiscoveryReviewSetId $ediscoveryReviewSetId -BodyParameter $params

0 commit comments

Comments
 (0)