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

perf: Short-circuit deployment if ARM template hasn't changed #239

Merged
merged 1 commit into from
Aug 16, 2019

Conversation

tbarlow12
Copy link
Contributor

@tbarlow12 tbarlow12 commented Aug 13, 2019

This checks the previously deployed template (including parameters/values) to see if the generated template has changed since the last deployment. If it has not changed, it will not deploy the ARM template. Since many cases will be code changes, this will drastically increase the speed of the average deployment.

Resolves [AB#789]

@tbarlow12 tbarlow12 requested review from wbreza and mydiemho August 13, 2019 04:14
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.

Looks good overall - Added a few comments that I would like to see addressed before merged.

this.log(JSON.stringify(object, null, 2));
}

protected deepEqual(obj1: any, obj2: any) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think deepEqual belongs as a function int the base service. Since it's an direct passthrough just have the consumer import and use it.

* Get the most recent resource group deployment
*/
public async getLastDeployment() {
const deployments = await this.getDeployments();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these deployments contain timestamp? If so do we know it is in the proper order to pull latest version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They have always come in order of most recent to least recent. I can sort it by the official deployment timestamp (included in metadata, even if timestamp is not included in name)

@tbarlow12 tbarlow12 force-pushed the tabarlow/optimize-deployment branch 2 times, most recently from ddf15d0 to 5b5f31f Compare August 13, 2019 18:36
@tbarlow12 tbarlow12 force-pushed the tabarlow/optimize-deployment branch from 5b5f31f to 9e4ffd5 Compare August 15, 2019 22:03
@tbarlow12 tbarlow12 force-pushed the tabarlow/optimize-deployment branch from 9e4ffd5 to 5f553f1 Compare August 16, 2019 14:37
@tbarlow12 tbarlow12 merged commit 327511c into dev Aug 16, 2019
@tbarlow12 tbarlow12 deleted the tabarlow/optimize-deployment branch August 16, 2019 14:53
tbarlow12 added a commit that referenced this pull request Sep 13, 2019
This checks the previously deployed template (including parameters/values) to see if the generated template has changed since the last deployment. If it has not changed, it will not deploy the ARM template. Since many cases will be code changes, this will drastically increase the speed of the average deployment.

Resolves [AB#789]
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.

3 participants