Skip to content

Commit

Permalink
changed template structure
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyang-li committed Mar 22, 2024
1 parent 1b2d599 commit b912c14
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 10,909 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
azcliversion: 2.30.0
inlineScript: |
chmod +x $GITHUB_WORKSPACE/deploy.sh
$GITHUB_WORKSPACE/deploy.sh stf-${{ matrix.location }} ${{ matrix.location }}
$GITHUB_WORKSPACE/deploy.sh stf-${{ matrix.location }} ${{ matrix.location }} templates/stf-prod.json
build-api-app:
needs: get-locations
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To introduce changes to the framework and set up local testing, please follow th
4. Get access to the "WAWS Swift Test" Azure subscription. (Needed to test ARM template changes)


### Manipulating Azure Resources
### Creating Azure Resources

There is a resource group deployed to every region defined in `location_matrix.json`. To extend this framework to another region, add the desired region name to this file.

Expand All @@ -28,17 +28,17 @@ The ARM templates that define the resources are located in the `templates` folde
To locally test ARM template changes, you can deploy resources to Azure using Azure Powershell.

1. Open Powershell and login to Azure with: `az login`
2. Set your subscription to the 'WAWS Swift Test': `Az-SetContext {WAWS Swift Test Subscription ID}` (You may need to run `az account set --subscription {WAWS Swift Test Subscription ID}` instead if Azure CLI is already set up for your Powershell instead of Azure Powershell.)
2. Set your subscription to the 'WAWS Swift Test': `az account set --subscription {WAWS Swift Test Subscription ID}` (You may need to run `Az-SetContext {WAWS Swift Test Subscription ID}` instead if Azure Powershell is already set up for your Powershell instead of Azure CLI.)
3. Add ARM template changes to `templates\stf-test.json` file.
4. Run: `.\deploy.ps1 -projectName {resource group name} -location {desired location}`
4. Run: `.\deploy.ps1 -projectName {resource group name} -location {desired location} -templateFile .\templates\stf-test.json`
5. Navigate to the specified resource group in the Azure portal to verify that the deployment succeeded.
6. Copy over all contents from stf-test.json to stf-prod.json once you have tested the deployment so that the Github Actions workflow will deploy your changes across all regions once the changes have been checked in.


### Adding API Changes
### Adding API Controller

Each resource group contains canary web apps that will host an API app to connect/interact with other resources in the group. The code for these apps is located under `src\SwiftTestingFrameworkAPI`.

The app is an ASP.NET Core web API project, and you will need to make a new API endpoint for each new feature/test you would like to add to the framework.
The app is an ASP.NET Core web API project, and you will need to make a new API controller for each new feature/test you would like to add to the framework.

This is a good resource for developing ASP.NET Core API code: [https://learn.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-6.0](https://learn.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-6.0)

Expand Down
4 changes: 2 additions & 2 deletions deploy.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param([string]$projectName, [string]$location)
param([string]$projectName, [string]$location, [string]$templateFile)

az group delete --resource-group $projectName --yes
az group create --resource-group $projectName --location $location
az deployment group create --resource-group $projectName --template-file "templates\stf-test.json" --parameters projectName=$projectName adminUsername=aleksbol adminPublicKey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsGHFYhLieeRSlgreDQU9eyl8feMMa/7HQosSyGqKuiXjQ4ngzc9peKqYI8AV4gpWBysOlovaj9DfyHHGlm/f6bl+I881o3E0iU+xYpdPIQXUAkkRCMCdwXEIFY3hnMykbCGHTU2+XIglNEfT+kDhDEPYP4bMlBTKY03LIOYo3Ur71oUiIV56U7fmB9EygVDSk3n05rm23qd/ek5BLXbu6wY/f0RxSdwlf07xujkMiQyqR2Iug8sWGjiMkgH6RIxSQRI0u+uLwxeerH2JT37k4TfdCeXmRi3uPDa+xpZS5/A9DCmPFbAS6uSHrlMxZ9LiR/WKZdu7aOh/sY0hV/tDbdQkVXDJt2Erht1Qs2upKsLRLfDO+/9Wtmx2Uew1R/hqbaavZl3j0GmqN+vxQ6aEtrWbq2rbzxOmPM7aLOjnoU/j2IZZe7opjETrVsWVilvHuo0/dtqfI1QOQ6HpvD6f/Oa1i2A/QXSETdUb03trhB3Ylig5LOIxxrcdFxlXu3ZhgsAFGN7Tk5Q5ZBqn9JjPtneDr/6yXBDXWtf0ZeqtjF2L2k+AFZ39j3JMxGtZWw0I8c2yslNVIf1o+tW3ya9aeC3u8BoHcpThrVVX6WBHha+szcExH/dQvsvcSGnDmLOzIVUeGInLTXrLAwtYZBrPDTmbKrBBPypE7joLbt+J31w== redmond\aleksbol@LAPTOP-GA4VCRGE"
az deployment group create --resource-group $projectName --template-file $templateFile --parameters projectName=$projectName
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
az group delete --resource-group $1 --yes
az group create --resource-group $1 --location "$2"
az deployment group create --resource-group $1 --template-file "templates/$1.json" --parameters projectName=$1 adminUsername=aleksbol adminPublicKey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsGHFYhLieeRSlgreDQU9eyl8feMMa/7HQosSyGqKuiXjQ4ngzc9peKqYI8AV4gpWBysOlovaj9DfyHHGlm/f6bl+I881o3E0iU+xYpdPIQXUAkkRCMCdwXEIFY3hnMykbCGHTU2+XIglNEfT+kDhDEPYP4bMlBTKY03LIOYo3Ur71oUiIV56U7fmB9EygVDSk3n05rm23qd/ek5BLXbu6wY/f0RxSdwlf07xujkMiQyqR2Iug8sWGjiMkgH6RIxSQRI0u+uLwxeerH2JT37k4TfdCeXmRi3uPDa+xpZS5/A9DCmPFbAS6uSHrlMxZ9LiR/WKZdu7aOh/sY0hV/tDbdQkVXDJt2Erht1Qs2upKsLRLfDO+/9Wtmx2Uew1R/hqbaavZl3j0GmqN+vxQ6aEtrWbq2rbzxOmPM7aLOjnoU/j2IZZe7opjETrVsWVilvHuo0/dtqfI1QOQ6HpvD6f/Oa1i2A/QXSETdUb03trhB3Ylig5LOIxxrcdFxlXu3ZhgsAFGN7Tk5Q5ZBqn9JjPtneDr/6yXBDXWtf0ZeqtjF2L2k+AFZ39j3JMxGtZWw0I8c2yslNVIf1o+tW3ya9aeC3u8BoHcpThrVVX6WBHha+szcExH/dQvsvcSGnDmLOzIVUeGInLTXrLAwtYZBrPDTmbKrBBPypE7joLbt+J31w== redmond\aleksbol@LAPTOP-GA4VCRGE"
az deployment group create --resource-group $1 --template-file $3 --parameters projectName=$1
Loading

0 comments on commit b912c14

Please sign in to comment.