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

feat: Automation flow for one click deployment #1290

Closed
wants to merge 4 commits into from

Conversation

Prashant-Microsoft
Copy link
Contributor

@Prashant-Microsoft Prashant-Microsoft commented Sep 6, 2024

Purpose

Automation for one click deployment and cleanup the resources

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Run the automation pipeline

Copy link

github-actions bot commented Sep 6, 2024

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL265959277% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
299 0 💤 0 ❌ 0 🔥 39.480s ⏱️

az deployment sub create \
--name automation-CWYD \
--location eastus \
--template-file infra/main.bicep \
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is to test the one click deploy button then I think this should use the infra/main.json file instead of the bicep file.

Copy link
Contributor Author

@Prashant-Microsoft Prashant-Microsoft Sep 10, 2024

Choose a reason for hiding this comment

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

There are basically two ways:

  1. we can use directly bicep files to deploy the resource
  2. or else first we need to generate arm template (nothing but main.json file) from bicep file. after it we can deploy the resources.
    So, we are using step 1, instead of creating arm templates, directly using bicep file

Is there any specific reason that you are asking to use main.json file instead of bicep module? Please let us know.

--name automation-CWYD \
--location eastus \
--template-file infra/main.bicep \
--parameters environmentName=pslautomationtest location=eastus2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there also be a step to tear this down and clean up the resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, we are implementing that also.


- name: Login to Azure
run: |
az login --service-principal -u ${{ secrets.AUTO_AZURE_CLIENT_ID }} -p ${{ secrets.AUTO_AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AUTO_AZURE_TENANT_ID }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We've created new variables AUTO_ - and not re-using the existing ones - we should update the existing github variables to your new subscription values and use them. At the moment, this strikes me as making things more complicated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For testing purposes, we have created these variables so that they won't affect the current deployment. In the end, we will be using the same variables.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The current deployment is not working as the spn has expired - you are free to re-use those variables if you like

@ross-p-smith
Copy link
Collaborator

hi there - can you help me understand what this PR is trying to do? What is the end goal? There is a ci.yml workflow which calls make deploy that deploys the infrastructure. I'm happy to jump on a call and discuss - but I feel you are re-inventing the wheel.

@ross-p-smith
Copy link
Collaborator

I've just looked into this and the credentials used to deploy have expired. I feel that it is best that you enter your credentials into the existing GH actions variables and get the build working again

@ross-p-smith
Copy link
Collaborator

I feel that you have fixed the current build and that it is deploying to your subscription and destroying on every push to main - I feel that you should close this PR now as it adds no "new" benefit

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.

3 participants