This repository was archived by the owner on May 13, 2025. It is now read-only.
forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 17
Stage Public Version of k8s-extension 0.2.0 for official release #15
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
828f9d3
Create pull.yml
jonathan-innis 1436bfc
Update pull.yml
jonathan-innis 6cffd96
Update azure-pipelines.yml
jonathan-innis db0f4bd
Initial commit of k8s-extension
jonathan-innis 3e2ea64
Update pipelines file
jonathan-innis 9bbc0e4
Update CODEOWNERS
jonathan-innis 8d46cbc
Update private preview pipelines
jonathan-innis 6c3ba41
Remove open service mesh from public release
jonathan-innis 43c6796
Update pipeline files
jonathan-innis 009a83e
Update public extension pipeline
jonathan-innis 8e058c5
Change condition variable
jonathan-innis dea40c1
Add version to public preview/private preview
jonathan-innis 69269e0
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
jonathan-innis e81e010
Update pipelines
jonathan-innis 9621a48
Add different testing based on private branch
jonathan-innis 862a035
Add annotations to extension model
jonathan-innis e1c3d12
Update k8s-custom-pipelines.yml
jonathan-innis 3e309bf
Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13)
jonathan-innis 1df2ef5
remove py2 bdist support
jonathan-innis 054a903
Add custom table formatting
jonathan-innis b298252
Remove unnecessary files
jonathan-innis afb4046
Fix style issues
jonathan-innis a13304d
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
aa078b0
Merge branch 'release' into k8s-extension/public
jonathan-innis 21dff06
Fix branch based on comments
jonathan-innis 93919f2
Update identity piece manually
jonathan-innis a88127a
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis 7e40b3a
Don't handle defaults at the CLI level
jonathan-innis d1befa8
Remove defaults from CLI client
jonathan-innis c7bd93f
Merge branch 'release' into k8s-extension/public
jonathan-innis 076827c
Check null target namespace with namespace scope
jonathan-innis 550eea1
Update style
jonathan-innis 1a17f1b
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis fbab3be
Add cassandra operator and location to model
jonathan-innis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,356 @@ | ||
| resources: | ||
| repositories: | ||
| - repository: K8sPartnerExtensionTest | ||
| type: git | ||
| endpoint: AzureReposConnection | ||
| name: One/compute-HybridMgmt-K8sPartnerExtensionTest | ||
|
|
||
| trigger: | ||
| batch: true | ||
| branches: | ||
| include: | ||
| - k8s-extension/public | ||
| - k8s-extension/private | ||
| pr: | ||
| branches: | ||
| include: | ||
| - k8s-extension/public | ||
| - k8s-extension/private | ||
|
|
||
| stages: | ||
| - stage: BuildTestPublishExtension | ||
| displayName: "Build, Test, and Publish Extension" | ||
| variables: | ||
| K8S_EXTENSION_REPO_PATH: $(Agent.BuildDirectory)/s/compute-HybridMgmt-K8sPartnerExtensionTest | ||
| CLI_REPO_PATH: $(Agent.BuildDirectory)/s/azure-cli-extensions | ||
| SUBSCRIPTION_ID: "15c06b1b-01d6-407b-bb21-740b8617dea3" | ||
| RESOURCE_GROUP: "K8sPartnerExtensionTest" | ||
| BASE_CLUSTER_NAME: "k8s-extension-cluster" | ||
| IS_PRIVATE_BRANCH: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/k8s-extension/private'), eq(variables['System.PullRequest.TargetBranch'], 'refs/heads/k8s-extension/private'))] | ||
|
|
||
| EXTENSION_NAME: "k8s-extension" | ||
| EXTENSION_FILE_NAME: "k8s_extension" | ||
| jobs: | ||
| - job: K8sExtensionTestSuite | ||
| displayName: "Run the Test Suite" | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - checkout: self | ||
| - checkout: K8sPartnerExtensionTest | ||
| - bash: | | ||
| echo "Installing helm3" | ||
| curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | ||
| chmod 700 get_helm.sh | ||
| ./get_helm.sh | ||
|
|
||
| echo "Installing kubectl" | ||
| curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" | ||
| chmod +x ./kubectl | ||
| sudo mv ./kubectl /usr/local/bin/kubectl | ||
| kubectl version --client | ||
| displayName: "Setup the VM with helm3 and kubectl" | ||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python 3.6' | ||
| inputs: | ||
| versionSpec: 3.6 | ||
| - bash: | | ||
| set -ev | ||
| echo "Building extension ${EXTENSION_NAME}..." | ||
|
|
||
| # prepare and activate virtualenv | ||
| pip install virtualenv | ||
| python3 -m venv env/ | ||
| source env/bin/activate | ||
|
|
||
| # clone azure-cli | ||
| pip install azdev | ||
|
|
||
| ls $(CLI_REPO_PATH) | ||
|
|
||
| azdev --version | ||
| azdev setup -r $(CLI_REPO_PATH) -e $(EXTENSION_NAME) | ||
| azdev extension build $(EXTENSION_NAME) | ||
|
|
||
| workingDirectory: $(CLI_REPO_PATH) | ||
| displayName: "Setup and Build Extension with azdev" | ||
|
|
||
| - bash: | | ||
| K8S_EXTENSION_VERSION=$(ls ${EXTENSION_FILE_NAME}* | cut -d "-" -f2) | ||
| echo "##vso[task.setvariable variable=K8S_EXTENSION_VERSION]$K8S_EXTENSION_VERSION" | ||
| cp * $(K8S_EXTENSION_REPO_PATH)/bin | ||
| workingDirectory: $(CLI_REPO_PATH)/dist | ||
| displayName: "Copy the Built .whl to Extension Test Path" | ||
|
|
||
| - bash: | | ||
| RAND_STR=$RANDOM | ||
| AKS_CLUSTER_NAME="${BASE_CLUSTER_NAME}-${RAND_STR}-aks" | ||
| ARC_CLUSTER_NAME="${BASE_CLUSTER_NAME}-${RAND_STR}-arc" | ||
|
|
||
| JSON_STRING=$(jq -n \ | ||
| --arg SUB_ID "$SUBSCRIPTION_ID" \ | ||
| --arg RG "$RESOURCE_GROUP" \ | ||
| --arg AKS_CLUSTER_NAME "$AKS_CLUSTER_NAME" \ | ||
| --arg ARC_CLUSTER_NAME "$ARC_CLUSTER_NAME" \ | ||
| --arg K8S_EXTENSION_VERSION "$K8S_EXTENSION_VERSION" \ | ||
| '{subscriptionId: $SUB_ID, resourceGroup: $RG, aksClusterName: $AKS_CLUSTER_NAME, arcClusterName: $ARC_CLUSTER_NAME, extensionVersion: {"k8s-extension": $K8S_EXTENSION_VERSION, connectedk8s: "1.0.0"}}') | ||
| echo $JSON_STRING > settings.json | ||
| cat settings.json | ||
| workingDirectory: $(K8S_EXTENSION_REPO_PATH) | ||
| displayName: "Generate a settings.json file" | ||
|
|
||
| - bash : | | ||
| echo "Downloading the kind script" | ||
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64 | ||
| chmod +x ./kind | ||
| ./kind create cluster | ||
| displayName: "Create and Start the Kind cluster" | ||
|
|
||
| - task: AzureCLI@2 | ||
| displayName: Bootstrap | ||
| inputs: | ||
| azureSubscription: AzureResourceConnection | ||
| scriptType: pscore | ||
| scriptLocation: inlineScript | ||
| inlineScript: | | ||
| .\Bootstrap.ps1 -CI | ||
| workingDirectory: $(K8S_EXTENSION_REPO_PATH) | ||
|
|
||
| - task: AzureCLI@2 | ||
| displayName: Run the Test Suite Public Extensions Only | ||
| inputs: | ||
| azureSubscription: AzureResourceConnection | ||
| scriptType: pscore | ||
| scriptLocation: inlineScript | ||
| inlineScript: | | ||
| .\Test.ps1 -CI -ExtensionType Public -OnlyPublicTests | ||
| workingDirectory: $(K8S_EXTENSION_REPO_PATH) | ||
| continueOnError: true | ||
| condition: and(succeeded(), eq(variables['IS_PRIVATE_BRANCH'], 'False')) | ||
|
|
||
| - task: AzureCLI@2 | ||
| displayName: Run the Test Suite on Private + Public Extensions | ||
| inputs: | ||
| azureSubscription: AzureResourceConnection | ||
| scriptType: pscore | ||
| scriptLocation: inlineScript | ||
| inlineScript: | | ||
| .\Test.ps1 -CI -ExtensionType Public | ||
| workingDirectory: $(K8S_EXTENSION_REPO_PATH) | ||
| continueOnError: true | ||
| condition: and(succeeded(), eq(variables['IS_PRIVATE_BRANCH'], 'True')) | ||
|
|
||
| - task: PublishTestResults@2 | ||
| inputs: | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '**/TestResults.xml' | ||
| failTaskOnFailedTests: true | ||
| condition: succeededOrFailed() | ||
|
|
||
| - task: AzureCLI@2 | ||
| displayName: Cleanup | ||
| inputs: | ||
| azureSubscription: AzureResourceConnection | ||
| scriptType: pscore | ||
| scriptLocation: inlineScript | ||
| inlineScript: | | ||
| .\Cleanup.ps1 -CI | ||
| workingDirectory: $(K8S_EXTENSION_REPO_PATH) | ||
| condition: succeededOrFailed() | ||
|
|
||
| - job: BuildPublishExtension | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| displayName: "Build and Publish the Extension Artifact" | ||
| variables: | ||
| CLI_REPO_PATH: $(Agent.BuildDirectory)/s | ||
| steps: | ||
| - bash: | | ||
| echo "Using the private preview of k8s-extension to build..." | ||
|
|
||
| cp $(CLI_REPO_PATH)/src/k8s-extension $(CLI_REPO_PATH)/src/k8s-extension-private -r | ||
| cp $(CLI_REPO_PATH)/src/k8s-extension-private/azext_k8s_extension/_consts_private.py $(CLI_REPO_PATH)/src/k8s-extension-private/azext_k8s_extension/_consts.py | ||
|
|
||
| EXTENSION_NAME="k8s-extension-private" | ||
| EXTENSION_FILE_NAME="k8s_extension_private" | ||
|
|
||
| echo "##vso[task.setvariable variable=EXTENSION_NAME]$EXTENSION_NAME" | ||
| echo "##vso[task.setvariable variable=EXTENSION_FILE_NAME]$EXTENSION_FILE_NAME" | ||
| condition: and(succeeded(), eq(variables['IS_PRIVATE_BRANCH'], 'True')) | ||
| displayName: "Copy Files, Set Variables for k8s-extension-private" | ||
| - bash: | | ||
| echo "Using the public version of k8s-extension to build..." | ||
|
|
||
| EXTENSION_NAME="k8s-extension" | ||
| EXTENSION_FILE_NAME="k8s_extension" | ||
|
|
||
| echo "##vso[task.setvariable variable=EXTENSION_NAME]$EXTENSION_NAME" | ||
| echo "##vso[task.setvariable variable=EXTENSION_FILE_NAME]$EXTENSION_FILE_NAME" | ||
| condition: and(succeeded(), eq(variables['IS_PRIVATE_BRANCH'], 'False')) | ||
| displayName: "Copy Files, Set Variables for k8s-extension" | ||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python 3.6' | ||
| inputs: | ||
| versionSpec: 3.6 | ||
| - bash: | | ||
| set -ev | ||
| echo "Building extension ${EXTENSION_NAME}..." | ||
|
|
||
| # prepare and activate virtualenv | ||
| pip install virtualenv | ||
| python3 -m venv env/ | ||
| source env/bin/activate | ||
|
|
||
| # clone azure-cli | ||
| pip install azdev | ||
|
|
||
| ls $(CLI_REPO_PATH) | ||
|
|
||
| azdev --version | ||
| azdev setup -r $(CLI_REPO_PATH) -e $(EXTENSION_NAME) | ||
| azdev extension build $(EXTENSION_NAME) | ||
| workingDirectory: $(CLI_REPO_PATH) | ||
| displayName: "Setup and Build Extension with azdev" | ||
| - task: PublishBuildArtifacts@1 | ||
| inputs: | ||
| pathToPublish: $(CLI_REPO_PATH)/dist | ||
|
|
||
| - stage: AzureCLIOfficial | ||
| displayName: "Azure Official CLI Code Checks" | ||
| dependsOn: [] | ||
| jobs: | ||
| - job: CheckLicenseHeader | ||
| displayName: "Check License" | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python 3.6' | ||
| inputs: | ||
| versionSpec: 3.6 | ||
| - bash: | | ||
| set -ev | ||
|
|
||
| # prepare and activate virtualenv | ||
| python -m venv env/ | ||
|
|
||
| chmod +x ./env/bin/activate | ||
| source ./env/bin/activate | ||
|
|
||
| # clone azure-cli | ||
| git clone -q --single-branch -b dev https://github.com/Azure/azure-cli.git ../azure-cli | ||
|
|
||
| pip install -q azdev | ||
|
|
||
| azdev setup -c ../azure-cli -r ./ | ||
|
|
||
| azdev --version | ||
| az --version | ||
|
|
||
| azdev verify license | ||
|
|
||
| - job: StaticAnalysis | ||
| displayName: "Static Analysis" | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python 3.6' | ||
| inputs: | ||
| versionSpec: 3.6 | ||
| - bash: pip install wheel==0.30.0 pylint==1.9.5 flake8==3.5.0 requests | ||
| displayName: 'Install wheel, pylint, flake8, requests' | ||
| - bash: python scripts/ci/source_code_static_analysis.py | ||
| displayName: "Static Analysis" | ||
|
|
||
| - job: IndexVerify | ||
| displayName: "Verify Extensions Index" | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python 3.7' | ||
| inputs: | ||
| versionSpec: 3.7 | ||
| - bash: | | ||
| #!/usr/bin/env bash | ||
| set -ev | ||
| pip install wheel==0.30.0 requests packaging | ||
| export CI="ADO" | ||
| python ./scripts/ci/test_index.py -v | ||
| displayName: "Verify Extensions Index" | ||
|
|
||
| - job: SourceTests | ||
| displayName: "Integration Tests, Build Tests" | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| strategy: | ||
| matrix: | ||
| Python36: | ||
| python.version: '3.6' | ||
| Python38: | ||
| python.version: '3.8' | ||
| steps: | ||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python $(python.version)' | ||
| inputs: | ||
| versionSpec: '$(python.version)' | ||
| - bash: pip install wheel==0.30.0 | ||
| displayName: 'Install wheel==0.30.0' | ||
| - bash: ./scripts/ci/test_source.sh | ||
| displayName: 'Run integration test and build test' | ||
| env: | ||
| ADO_PULL_REQUEST_LATEST_COMMIT: $(System.PullRequest.SourceCommitId) | ||
| ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch) | ||
|
|
||
| - job: LintModifiedExtensions | ||
| displayName: "CLI Linter on Modified Extensions" | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python 3.6' | ||
| inputs: | ||
| versionSpec: 3.6 | ||
| - bash: | | ||
| set -ev | ||
|
|
||
| # prepare and activate virtualenv | ||
| pip install virtualenv | ||
| python -m virtualenv venv/ | ||
| source ./venv/bin/activate | ||
|
|
||
| # clone azure-cli | ||
| git clone --single-branch -b dev https://github.com/Azure/azure-cli.git ../azure-cli | ||
|
|
||
| pip install azdev | ||
|
|
||
| azdev --version | ||
|
|
||
| azdev setup -c ../azure-cli -r ./ -e k8s-extension | ||
|
|
||
| # overwrite the default AZURE_EXTENSION_DIR set by ADO | ||
| AZURE_EXTENSION_DIR=~/.azure/cliextensions az --version | ||
|
|
||
| AZURE_EXTENSION_DIR=~/.azure/cliextensions azdev linter --include-whl-extensions k8s-extension | ||
| displayName: "CLI Linter on Modified Extension" | ||
| env: | ||
| ADO_PULL_REQUEST_LATEST_COMMIT: $(System.PullRequest.SourceCommitId) | ||
| ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch) | ||
|
|
||
| - job: IndexRefDocVerify | ||
| displayName: "Verify Ref Docs" | ||
| pool: | ||
| vmImage: 'ubuntu-16.04' | ||
| steps: | ||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python 3.7' | ||
| inputs: | ||
| versionSpec: 3.7 | ||
| - bash: pip install wheel==0.30.0 | ||
| displayName: 'Install wheel==0.30.0' | ||
| - task: Bash@3 | ||
| displayName: "Verify Extension Ref Docs" | ||
| inputs: | ||
| targetType: 'filePath' | ||
| filePath: scripts/ci/test_index_ref_doc.sh | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.