Skip to content

Commit

Permalink
Creating yml file for ctl image build ci (#12926)
Browse files Browse the repository at this point in the history
* creating yml file for ctl image build ci

* Update ctl-image-build.yml

Co-authored-by: James Suplizio <[email protected]>
  • Loading branch information
simplynaveen20 and JimSuplizio authored Jul 8, 2020
1 parent 2f4f39f commit 2c6eb8a
Showing 1 changed file with 45 additions and 0 deletions.
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'
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'

0 comments on commit 2c6eb8a

Please sign in to comment.