Skip to content
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

support deployment status on web app #1339

Closed
wants to merge 32 commits into from

Conversation

weidongxu-microsoft
Copy link
Member

fix #1338

import com.microsoft.rest.serializer.JsonFlatten;

@JsonFlatten
public class DeploymentStatus extends ProxyResource {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Response class for deploymentStatus. Note this will get changed after swagger updated by service.

Comment on lines 530 to 564
* Asynchronous deploys a ZIP file onto the Azure specialized Java SE image on this web app.
*
* @see #getDeploymentStatusAsync(String)
* @param zipFile the ZIP file to upload
* @return the result of the deployment, which contains the deployment ID for query on the deployment status.
*/
Observable<AsyncDeploymentResult> pushZipDeployAsync(File zipFile);

/**
* Asynchronous deploys a ZIP file onto the Azure specialized Java SE image on this web app.
*
* @see #getDeploymentStatusAsync(String)
* @param zipFile the ZIP file to upload
* @return the result of the deployment, which contains the deployment ID for query on the deployment status.
*/
AsyncDeploymentResult pushZipDeploy(File zipFile);

/**
* Asynchronous deploys a ZIP file onto the Azure specialized Java SE image on this web app.
*
* @see #getDeploymentStatus(String)
* @param zipFile the ZIP file to upload
* @return the result of the deployment, which contains the deployment ID for query on the deployment status.
*/
AsyncDeploymentResult pushZipDeploy(InputStream zipFile);

/**
* Asynchronous deploys a ZIP file onto the Azure specialized Java SE image on this web app.
*
* @see #getDeploymentStatusAsync(String)
* @param zipFile the ZIP file to upload
* @return the result of the deployment, which contains the deployment ID for query on the deployment status.
*/
Observable<AsyncDeploymentResult> pushZipDeployAsync(InputStream zipFile);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API to do async ZipDeploy.

Comment on lines +566 to +580
* Gets the deployment status of the web app.
*
* @param deploymentId the deployment ID of the web app.
* @return the deployment status.
*/
Observable<DeploymentStatus> getDeploymentStatusAsync(String deploymentId);

/**
* Gets the deployment status of the web app.
*
* @param deploymentId the deployment ID of the web app.
* @return the deployment status.
*/
DeploymentStatus getDeploymentStatus(String deploymentId);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API to get deployment status. It will get changed after swagger updated.

Comment on lines 49 to 68
public void canGetDeploymentStatus() throws InterruptedException {
WebApp wa = appServiceManager.webApps().getByResourceGroup("rg-weidxu", "wa1weidxu");
AsyncDeploymentResult result = wa.pushZipDeploy(new File("C:/github/app.zip"));
DeploymentStatus status = wa.getDeploymentStatus(result.getDeploymentId());
while (status == null) {
System.out.println("status not ready");
Thread.sleep(10 * 1000);
// try again
status = wa.getDeploymentStatus(result.getDeploymentId());
}
BuildStatus buildStatus = status.buildStatus();
System.out.println("build status: " + buildStatus);
while (buildStatus != BuildStatus.BUILD_SUCCESSFUL) {
Thread.sleep(10 * 1000);
// poll again
status = wa.getDeploymentStatus(result.getDeploymentId());
buildStatus = status.buildStatus();
System.out.println("build status: " + buildStatus);
}
}
Copy link
Member Author

@weidongxu-microsoft weidongxu-microsoft Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample code for client.

@weidongxu-microsoft weidongxu-microsoft deleted the appservice-deployment-status branch July 29, 2022 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE REQ] Support web app zip deploy with deployment ID and get deployment status API
1 participant