Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
jobs:
- job: Cosmos CTL
timeoutInMinutes: 20
variables:
- template: /eng/pipelines/templates/variables/globals.yml
pool:
vmImage: 'ubuntu-18.04'

# java-cosmos-container-registry-pwd
variables:
ContainerRegistryName: 'javactl'
ContainerRegistryUserName: 'javactl'
ContainerRegistryUrl: 'javactl.azurecr.io'

steps:
- task: Maven@3
displayName: 'Build Cosmos and Benchmark'
inputs:
mavenPomFile: pom.xml
jdkVersionOption: $(JavaBuildVersion)
jdkArchitectureOption: 'x64'
# The -Ppackage-assembly profile packages up both libraries into one package
options: '$(DefaultOptions) -Ppackage-assembly -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true -pl com.azure:azure-cosmos,com.azure:azure-cosmos-benchmark'

- task: CopyFiles@2
displayName: 'Copy benchmark jar'
inputs:
SourceFolder: '$(build.sourcesdirectory)/sdk/cosmos/azure-cosmos-benchmark/target'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Given you are doing everything else in one pwsh script block below I'd probably move the copy commands into there as well.

Contents: '*'
TargetFolder: $(Agent.TempDirectory)/ctl

- task: CopyFiles@2
displayName: 'Copy docker config files'
inputs:
SourceFolder: '$(build.sourcesdirectory)/sdk/cosmos/azure-cosmos-benchmark/ctl'
TargetFolder: $(Agent.TempDirectory)/ctl

# Below will build the image and push it to azure container registry
- pwsh: |
cd $(Agent.TempDirectory)/ctl
docker build . -t java-ctl
az acr login --name $(ContainerRegistryName) -u $(ContainerRegistryUserName) -p $(java-cosmos-container-registry-pwd)
docker tag java-ctl $(ContainerRegistryUrl)/javactl/benchmark
docker push $(ContainerRegistryUrl)/javactl/benchmark
displayName: 'Build and push docker image to registry'