-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Azure Pipelines CI/CD and use python -m pip instead of pip execut…
…able Add Azure Pipelines CI/CD. Use python -m pip instead of pip2/3
- Loading branch information
Showing
5 changed files
with
178 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,149 @@ | ||
# Starter pipeline | ||
# Start with a minimal pipeline that you can customize to build and deploy your code. | ||
# Add steps that build, run tests, deploy, and more: | ||
# https://aka.ms/yaml | ||
|
||
trigger: | ||
- master | ||
|
||
strategy: | ||
matrix: | ||
linux: | ||
imageName: ubuntu-latest | ||
openJdkUrl: https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/ | ||
jdkName: openjdk-14.0.1_linux-x64_bin.tar.gz | ||
javaHome: $(Build.BinariesDirectory)/java/jdk-14.0.1 | ||
gradleWrapper: gradlew | ||
mac: | ||
imageName: macos-latest | ||
openJdkUrl: https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/ | ||
jdkName: openjdk-14.0.1_osx-x64_bin.tar.gz | ||
javaHome: $(Build.BinariesDirectory)/java/jdk-14.0.1.jdk/Contents/Home/ | ||
gradleWrapper: gradlew | ||
windows: | ||
imageName: windows-latest | ||
openJdkUrl: https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/ | ||
jdkName: openjdk-14.0.1_windows-x64_bin.zip | ||
javaHome: $(Build.BinariesDirectory)/java/jdk-14.0.1 | ||
gradleWrapper: gradlew.bat | ||
|
||
pool: | ||
vmImage: $(imageName) | ||
|
||
steps: | ||
- script: python2 --version | ||
displayName: 'Show python2 version' | ||
|
||
- script: python3 --version | ||
displayName: 'Show python3 version' | ||
jobs: | ||
- job: Assemble | ||
timeoutInMinutes: 10 | ||
variables: | ||
pythonDependencies: "sphinx==1.8 guzzle_sphinx_theme javalang" | ||
strategy: | ||
matrix: | ||
Linux: | ||
imageName: ubuntu-latest | ||
openJdkUrl: https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/ | ||
jdkName: openjdk-14.0.1_linux-x64_bin.tar.gz | ||
javaHome: $(Build.BinariesDirectory)/java/jdk-14.0.1 | ||
gradleWrapper: gradlew | ||
Mac: | ||
imageName: macos-latest | ||
openJdkUrl: https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/ | ||
jdkName: openjdk-14.0.1_osx-x64_bin.tar.gz | ||
javaHome: $(Build.BinariesDirectory)/java/jdk-14.0.1.jdk/Contents/Home/ | ||
gradleWrapper: gradlew | ||
Windows: | ||
imageName: windows-latest | ||
openJdkUrl: https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/ | ||
jdkName: openjdk-14.0.1_windows-x64_bin.zip | ||
javaHome: $(Build.BinariesDirectory)/java/jdk-14.0.1 | ||
gradleWrapper: gradlew.bat | ||
|
||
pool: | ||
vmImage: $(imageName) | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
name: GetPython3 | ||
inputs: | ||
versionSpec: '3.x' | ||
addToPath: true | ||
architecture: 'x64' | ||
|
||
- task: UsePythonVersion@0 | ||
name: GetPython2 | ||
inputs: | ||
versionSpec: '2.x' | ||
addToPath: false | ||
architecture: 'x64' | ||
|
||
- task: Bash@3 | ||
displayName: Standardize Java and Python Paths | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
function standardize_path { | ||
echo `echo "$1" | tr '\\' '/'` | ||
} | ||
p2=`standardize_path '$(GetPython2.pythonLocation)/python'` | ||
p3=`standardize_path '$(GetPython3.pythonLocation)/python'` | ||
JAVA_HOME=`standardize_path '$(javaHome)'` | ||
echo "Python2 -> ${p2}" | ||
echo "Python3 -> ${p3})" | ||
echo "JAVA_HOME -> ${JAVA_HOME}" | ||
echo "##vso[task.setvariable variable=python2]${p2}" | ||
echo "##vso[task.setvariable variable=python3]${p3}" | ||
echo "##vso[task.setvariable variable=JAVA_HOME]${JAVA_HOME}" | ||
- task: CmdLine@2 | ||
displayName: Install Python Dependencies | ||
inputs: | ||
script: | | ||
echo "Installing Python 3 dependencies" | ||
$(python3) -m pip install setuptools wheel | ||
$(python3) -m pip install $(pythonDependencies) | ||
echo "Installing Python 2 dependencies" | ||
$(python2) -m pip install setuptools wheel | ||
$(python2) -m pip install $(pythonDependencies) | ||
# Download the JDK | ||
- task: Bash@3 | ||
inputs: | ||
targetType: 'inline' | ||
script: 'curl --silent --remote-name $(openJdkUrl)$(jdkName)' | ||
workingDirectory: '$(Build.BinariesDirectory)' | ||
displayName: Download OpenJDK | ||
|
||
- task: ExtractFiles@1 | ||
displayName: Extract OpenJDK | ||
inputs: | ||
archiveFilePatterns: | | ||
$(Build.BinariesDirectory)/*.zip | ||
$(Build.BinariesDirectory)/*.tar.gz | ||
destinationFolder: $(Build.BinariesDirectory)/java | ||
cleanDestinationFolder: true | ||
|
||
- task: Bash@3 | ||
displayName: Assemble | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
export JAVA_HOME=$(JAVA_HOME) | ||
./$(gradleWrapper) -POSPREY_PYTHON3=$(python3) -POSPREY_PYTHON2=$(python2) -PAZURE_BUILD_ID=$(Build.BuildId) assemble | ||
- task: CopyFiles@2 | ||
inputs: | ||
SourceFolder: 'build/distributions' | ||
Contents: | | ||
*.zip | ||
TargetFolder: '$(Build.ArtifactStagingDirectory)' | ||
displayName: Copy distributions to staging dir | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
PathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
ArtifactName: $(Agent.OS) | ||
publishLocation: 'Container' | ||
displayName: Make staging dir an artifact | ||
|
||
- job: CreateRelease | ||
pool: | ||
vmImage: ubuntu-latest | ||
dependsOn: Assemble | ||
condition: ne(variables['Build.Reason'], 'PullRequest') | ||
steps: | ||
- bash: | | ||
version=$(<resources/config/version) | ||
echo "##vso[task.setvariable variable=version]${version}" | ||
displayName: Set version variable from version file | ||
- task: DownloadBuildArtifacts@0 | ||
inputs: | ||
buildType: 'current' | ||
downloadType: 'specific' | ||
downloadPath: '$(System.ArtifactsDirectory)' | ||
displayName: Download assembled artifacts | ||
- task: GitHubRelease@1 | ||
inputs: | ||
gitHubConnection: 'github.com_gusennan' | ||
repositoryName: '$(Build.Repository.Name)' | ||
action: 'create' | ||
target: '$(Build.SourceVersion)' | ||
tagSource: 'userSpecifiedTag' | ||
tag: '$(version).$(Build.BuildId)' | ||
assets: '$(System.ArtifactsDirectory)/**/osprey-*python*.zip' | ||
isDraft: true | ||
changeLogCompareToRelease: 'lastFullRelease' | ||
changeLogType: 'commitBased' | ||
title: '$(version).$(Build.BuildId)' | ||
displayName: Push draft release $(version).$(Build.BuildId) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.2-beta1 | ||
3.2 |