Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Conversation

@tbarlow12
Copy link
Contributor

Resolves [AB#352]

@tbarlow12 tbarlow12 requested review from mydiemho and wbreza June 21, 2019 15:59
Copy link
Contributor

@wbreza wbreza left a comment

Choose a reason for hiding this comment

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

Left some minor feedback, but looks good overall.

};

this.commands = {
deploy: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does defining these commands mess with the top level core plugin on the CLI ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was concerned about that, which is why I left out the lifecycleEvents (I defined them at first, which caused deploy to be triggered twice). I set the plugin to log this.commands to see what the object looks like by default, and itame back undefined. In my manual testing, the deployment still works fine. Feel free to double check me on that though.

const resourceService = new ResourceService(this.serverless, this.options);
const deployments = await resourceService.listDeployments();
let stringDeployments = "\n\nDeployments";
for (const dep of deployments) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If no deployments exist consider adding a line that says "No deployments found for resource group" or similar.

this.resourceClient = new ResourceManagementClient(this.credentials, this.subscriptionId);
}

public async listDeployments() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is more of a "get" operation and think we should rename to getDeployments. The listing/writing is happening in the plugin.

@tbarlow12 tbarlow12 force-pushed the tabarlow/list-deploy branch from 35fa9cf to 518144c Compare June 21, 2019 16:20
Copy link
Contributor

@mydiemho mydiemho left a comment

Choose a reason for hiding this comment

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

looks good. I suggest adding one more tests for empty deployments

.toBeCalledWith(resourceGroup);
});

it("lists deployments", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

another to test when deployments are empty

@tbarlow12 tbarlow12 merged commit 34db630 into dev Jun 21, 2019
@tbarlow12 tbarlow12 deleted the tabarlow/list-deploy branch June 21, 2019 20:27
tbarlow12 added a commit that referenced this pull request Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants