Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating yml file for ctl image build ci #12926

Merged
merged 2 commits into from
Jul 8, 2020
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
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'