-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Spring-Cloud] add Build Service related command for enterprise tier #4295
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
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
76cf97c
[Spring-Cloud] Add Build service for enterprise tier
smile37773 b0ed715
fix
smile37773 f4478f7
fix
smile37773 2838ffa
Update src/spring-cloud/azext_spring_cloud/_params.py
smile37773 30ded6d
Update src/spring-cloud/azext_spring_cloud/_params.py
smile37773 36c3e01
fix
smile37773 7da7b61
fix
smile37773 19e60b7
fix
smile37773 ac0ffaf
fix
smile37773 2a35037
Merge remote-tracking branch 'origin' into qingyliu/build-service
smile37773 b1d10d5
fix
smile37773 5e47e35
Update src/spring-cloud/azext_spring_cloud/_buildservices.py
smile37773 c5d1c8b
Update src/spring-cloud/azext_spring_cloud/_buildservices.py
smile37773 00f31d9
fix
smile37773 3da1853
fix
smile37773 6deaa1d
fix
smile37773 a03dca4
Merge remote-tracking branch 'origin' into qingyliu/build-service
smile37773 19b4f47
fix
smile37773 668a5bf
fix
smile37773 46238c9
fix
smile37773 dbc9cec
fix
smile37773 8888047
fix
smile37773 194b817
fix
smile37773 7877b79
fix
smile37773 bfbf842
fix
smile37773 8e60c93
fix
smile37773 d0223da
fix
smile37773 d03285e
fix
smile37773 43830f1
fix
smile37773 f4a573c
fix
smile37773 bc5db5c
fix
smile37773 a2c5bd3
fix
smile37773 ecca582
Update src/spring-cloud/azext_spring_cloud/_params.py
smile37773 5748fe5
Update src/spring-cloud/azext_spring_cloud/_params.py
smile37773 9d2e35f
fix
smile37773 71c532b
add delete test
smile37773 a7dd44f
fix
smile37773 690cd05
Merge branch 'main' into qingyliu/build-service
smile37773 821ac97
Update spring_cloud_instance.py
smile37773 5bc8787
Update commands.py
smile37773 b861619
Merge branch 'main' into qingyliu/build-service
smile37773 0de9300
Merge branch 'main' into qingyliu/build-service
smile37773 fd2538a
fix
smile37773 8f50489
fix
smile37773 5b2899c
Update _params.py
smile37773 ec7fb1d
fix
smile37773 3ba8b36
fix test
smile37773 a38102d
fix test
smile37773 431305e
fix test
smile37773 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| # pylint: disable=too-few-public-methods, unused-argument, redefined-builtin | ||
|
|
||
| import json | ||
| from azure.cli.core.util import sdk_no_wait | ||
| from .vendored_sdks.appplatform.v2022_01_01_preview import models | ||
|
|
||
| DEFAULT_BUILD_SERVICE_NAME = "default" | ||
| DEFAULT_BUILD_AGENT_POOL_NAME = "default" | ||
|
|
||
|
|
||
| def _update_default_build_agent_pool(cmd, client, resource_group, name, build_pool_size=None): | ||
| if build_pool_size is not None: | ||
| build_properties = models.BuildServiceAgentPoolProperties( | ||
| pool_size=models.BuildServiceAgentPoolSizeProperties( | ||
| name=build_pool_size)) | ||
| agent_pool_resource = models.BuildServiceAgentPoolResource( | ||
| properties=build_properties) | ||
| return client.build_service_agent_pool.begin_update_put( | ||
| resource_group, name, DEFAULT_BUILD_SERVICE_NAME, DEFAULT_BUILD_AGENT_POOL_NAME, agent_pool_resource) | ||
|
|
||
|
|
||
| def create_or_update_builder(cmd, client, resource_group, service, name, builder_json=None, builder_file=None, no_wait=False): | ||
| builder = _update_builder(builder_file, builder_json) | ||
| builder_resource = models.BuilderResource( | ||
| properties=builder | ||
| ) | ||
| return sdk_no_wait(no_wait, client.build_service_builder.begin_create_or_update, | ||
| resource_group, service, DEFAULT_BUILD_SERVICE_NAME, name, builder_resource) | ||
|
|
||
|
|
||
| def builder_show(cmd, client, resource_group, service, name): | ||
| return client.build_service_builder.get(resource_group, service, DEFAULT_BUILD_SERVICE_NAME, name) | ||
|
|
||
|
|
||
| def builder_delete(cmd, client, resource_group, service, name, no_wait=False): | ||
| return sdk_no_wait(no_wait, client.build_service_builder.begin_delete, resource_group, service, DEFAULT_BUILD_SERVICE_NAME, name) | ||
|
|
||
|
|
||
| def _update_builder(builder_file, builder_json): | ||
| if builder_file is not None: | ||
| with open(builder_file, 'r') as json_file: | ||
| builder = json.load(json_file) | ||
|
|
||
| if builder_json is not None: | ||
| builder = json.loads(builder_json) | ||
|
|
||
| return builder |
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
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
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
16 changes: 16 additions & 0 deletions
16
src/spring-cloud/azext_spring_cloud/tests/latest/files/build_service_builder.json
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,16 @@ | ||
| { | ||
| "stack": { | ||
| "id": "io.buildpacks.stacks.bionic", | ||
| "version": "base" | ||
| }, | ||
| "buildpackGroups": [ | ||
| { | ||
| "name": "mix", | ||
| "buildpacks": [ | ||
| { | ||
| "id": "tanzu-buildpacks/java-azure" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
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.