blob: a7dd375c4c580de2c78f4ec0c334491d7dd42f0c [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
jobs:
- job: compile_${{parameters.stage_name}}
pool:
vmImage: 'ubuntu-16.04'
container: flink-build-container
workspace:
clean: all
steps:
# Compile
- script: STAGE=compile ${{parameters.environment}} ./tools/azure_controller.sh compile
displayName: Build
- script: |
VERSION=$(mvn --file pom.xml org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)
echo "##vso[task.setvariable variable=VERSION;isOutput=true]$VERSION"
name: set_version
- script: |
cd $(Pipeline.Workspace)
tar czf $(Pipeline.Workspace)/flink.tar.gz flink_cache/flink-dist/target/flink-$(set_version.VERSION)-bin/flink-$(set_version.VERSION)
displayName: Compress in tgz
# upload artifacts for building wheels
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Pipeline.Workspace)/flink.tar.gz
artifactName: FlinkCompileCacheDir-${{parameters.stage_name}}
- job: build_wheels
dependsOn: compile_${{parameters.stage_name}}
strategy:
matrix:
linux:
vm-label: 'ubuntu-16.04'
mac:
vm-label: 'macOS-10.15'
pool:
vmImage: $(vm-label)
variables:
VERSION: $[ dependencies.compile_${{parameters.stage_name}}.outputs['set_version.VERSION'] ]
steps:
# download artifacts
- task: DownloadPipelineArtifact@2
inputs:
path: $(Pipeline.Workspace)
artifact: FlinkCompileCacheDir-${{parameters.stage_name}}
- script: |
tar zxf $(Pipeline.Workspace)/flink.tar.gz -C $(Pipeline.Workspace)
mkdir -p flink-dist/target/flink-$(VERSION)-bin
ln -snf $(CACHE_FLINK_DIR)/flink-dist/target/flink-$(VERSION)-bin/flink-$(VERSION) `pwd`/flink-dist/target/flink-$(VERSION)-bin/flink-$(VERSION)
displayName: Recreate 'flink-dist/target' symlink
- script: |
cd flink-python
bash dev/build-wheels.sh
displayName: Build wheels
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'wheel_$(Agent.OS)_$(Agent.JobName)'
targetPath: 'flink-python/dist'