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

Consolidate .Admin, .Api and .Mobile #507

Merged
merged 29 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b4fdbe8
Remove unused .sln
tkapa Dec 12, 2023
1d9b691
Rename SSW.Rewards to MobileUI
tkapa Dec 12, 2023
3813d49
Add API Projects
tkapa Dec 12, 2023
4e387e6
Add API Infra
tkapa Dec 12, 2023
5556882
Add AdminUI Project
tkapa Dec 12, 2023
86a5c5b
Update CSProj to build for iOS Simulator Arm64
tkapa Dec 12, 2023
75e6d35
Add AdminUI
tkapa Dec 12, 2023
8fd033e
Update CI/CD
tkapa Dec 12, 2023
d10700a
Update with .azure templates
tkapa Dec 12, 2023
4581ed7
add-cycling-secret-fix
tkapa Dec 13, 2023
403d937
update actions
tkapa Dec 13, 2023
bca201e
Merge .API and .Mobile .bicep changes
tkapa Dec 13, 2023
38f68be
Fix Swagger UI
tkapa Dec 13, 2023
c3dbd4c
Remove bad project paths
tkapa Dec 13, 2023
79a51af
Fix AdminUI + Test Projects
tkapa Dec 13, 2023
c3d16ee
More Workflows into one folder
tkapa Dec 13, 2023
0c7dc0d
Update mobile .yml
tkapa Dec 13, 2023
0370832
Consistent namin for .bicep files
tkapa Dec 13, 2023
35f36da
Rename main.bicep
tkapa Dec 13, 2023
32fe7dd
Add workload restore to admin ci
tkapa Dec 13, 2023
c3a3054
Update to run
tkapa Dec 13, 2023
8934d0a
Use workload restore
tkapa Dec 13, 2023
7fc5af8
Target admin project
tkapa Dec 13, 2023
fa85ed0
Remove Component folder ignore
tkapa Dec 13, 2023
94982ec
Update .gitignore to include /test appsettings.json
tkapa Dec 14, 2023
7014bb3
Remove appsettings.json ignore. Replace templates
tkapa Dec 14, 2023
cc8077a
Remove ios-arm64 - From tylah
tkapa Dec 15, 2023
bebacd6
Add infra folder
tkapa Dec 15, 2023
7b34665
Set RuntimeIdentifier to iossimulator-x64 when debugging to resolve c…
zacharykeeping Dec 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 38 additions & 0 deletions .azure/pipeline-admin-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
trigger:
branches:
include:
- master
paths:
include:
- "/Blazor/*"

pool:
vmImage: "ubuntu-latest"

variables:
system.debug: true
agent.diagnostic: true

stages:
- template: ./templates/build-ui-stage.yml
parameters:
WorkingDirectory: $(System.DefaultWorkingDirectory)/Blazor
BlazorProjectFile: SSW.Rewards.Admin.csproj
ArtifactName: adminUI
StageName: Build

- template: ./templates/deploy-ui-stage.yml
parameters:
EnvironmentName: Dev
AzureSubscriptionName: "SSW.Consulting.Dev"
DependsOnStageName: Build
ArtifactName: adminUI
SourcePath: "Blazor/wwwroot"

- template: ./templates/deploy-ui-stage.yml
parameters:
EnvironmentName: Prod
AzureSubscriptionName: "SSW.Consulting.Prod"
DependsOnStageName: Dev
ArtifactName: adminUI
SourcePath: "Blazor/wwwroot"
30 changes: 30 additions & 0 deletions .azure/templates/build-blazor-ui-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
parameters:
BuildId: "Unknown"
BuildConfiguration: Release
WorkingDirectory:
BlazorProjectFile:
ArtifactName:

steps:
- task: UseDotNet@2
displayName: Use Correct .NET SDK
inputs:
packageType: sdk
useGlobalJson: true
workingDirectory: ${{parameters.WorkingDirectory}}

- task: DotNetCoreCLI@2
displayName: DotNET Publish ${{parameters.ArtifactName}}
inputs:
command: 'publish'
zipAfterPublish: false
projects: |
${{parameters.WorkingDirectory}}/${{parameters.BlazorProjectFile}}
arguments: --output ${{parameters.WorkingDirectory}}/published_ui --configuration ${{parameters.BuildConfiguration}}

- task: PublishBuildArtifacts@1
displayName: Publish Artifacts
inputs:
PathtoPublish: ${{parameters.WorkingDirectory}}/published_ui
ArtifactName: '${{parameters.ArtifactName}}'
publishLocation: 'Container'
17 changes: 17 additions & 0 deletions .azure/templates/build-ui-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
parameters:
ArtifactName:
WorkingDirectory:
StageName:

stages:
- stage: ${{parameters.StageName}}
displayName: Build and Publish artifacts
jobs:
- job: BuildAndPublishBlazorUI
displayName: Build and Publish artifacts
steps:
- template: build-blazor-ui-tasks.yml
parameters:
ArtifactName: ${{parameters.ArtifactName}}
BuildId: $(Build.BuildId)
WorkingDirectory: ${{parameters.WorkingDirectory}}
48 changes: 48 additions & 0 deletions .azure/templates/deploy-ui-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
parameters:
AzureSubscriptionName:
EnvironmentName:
ArtifactName:
SourcePath:
DependsOnStageName:
ProjectName:

stages:
- stage: ${{parameters.EnvironmentName}}
dependsOn: ${{parameters.DependsOnStageName}}
displayName: Deploy ${{parameters.ProjectName}} to ${{parameters.EnvironmentName}}
# prevent deployment on PullRequest builds (Reason != PullRequest)
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
jobs:
- deployment: Deploy
environment: ${{parameters.EnvironmentName}}
pool:
vmImage: 'ubuntu-latest'
variables:
# Load the environment specific azure infrastructure variable groups
# e.g. Dev-infra, Staging-infra, Prod-infra
- group: ${{parameters.EnvironmentName}}-infra

# IMPORTANT: This is the naming convention for resource groups
# - e.g. SSW.Consulting.Dev, SSW.Consulting.Staging, SSW.Consulting.Prod
- name: resourceGroupName
value: SSW.Consulting.${{parameters.EnvironmentName}}

strategy:
runOnce:
deploy:
steps:
- template: deploy-ui-to-static-website-tasks.yml
parameters:
AzureSubscriptionName: ${{parameters.AzureSubscriptionName}}
ResourceGroupName: $(resourceGroupName)
StaticSiteAccountName: $(AdminStaticSiteAccountName)
StaticSiteAccountKey: $(AdminStaticSiteAccountKey)
ArtifactName: '$(Pipeline.Workspace)/${{parameters.ArtifactName}}'
SourcePath: ${{parameters.SourcePath}}

- template: purge-cdn.yml
parameters:
AzureSubscriptionName: ${{parameters.AzureSubscriptionName}}
ResourceGroupName: $(resourceGroupName)
CdnEndpointName: $(CdnEndpointName)
CdnProfileName: $(CdnProfileName)
34 changes: 34 additions & 0 deletions .azure/templates/deploy-ui-to-static-website-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
parameters:
AzureSubscriptionName:
ResourceGroupName:
StaticSiteAccountName:
StaticSiteAccountKey:
ArtifactName:
SourcePath:

steps:
- task: PowerShell@2
displayName: List Environment Variables
inputs:
targetType: 'inline'
pwsh: true
errorActionPreference: 'continue'
script: |
Get-ChildItem env:

- task: FileTransform@1
# replace any key-value pairs in the appsettings file with values from the available variable groups
displayName: Substitute values in appsettings
inputs:
folderPath: '${{parameters.ArtifactName}}/${{parameters.SourcePath}}'
fileType: 'json'
targetFiles: '**/appsettings.json'

- task: AzureCLI@2
displayName: Upload front-end to static web site in blog storage
inputs:
azureSubscription: '${{parameters.AzureSubscriptionName}}'
scriptType: pscore
scriptLocation: 'inlineScript'
inlineScript: |
az storage blob upload-batch --account-name ${{parameters.StaticSiteAccountName}} --account-key '${{parameters.StaticSiteAccountKey}}' -s '${{parameters.ArtifactName}}/${{parameters.SourcePath}}/' -d '$web' --overwrite true
15 changes: 15 additions & 0 deletions .azure/templates/purge-cdn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
parameters:
AzureSubscriptionName:
ResourceGroupName:
CdnEndpointName:
CdnProfileName:

steps:
- task: AzureCLI@2
displayName: Purge CDN content
inputs:
azureSubscription: '${{parameters.AzureSubscriptionName}}'
scriptType: pscore
scriptLocation: 'inlineScript'
inlineScript: |
az cdn endpoint purge -g ${{parameters.ResourceGroupName}} -n ${{parameters.CdnEndpointName}} --profile-name ${{parameters.CdnProfileName}} --content-paths '/*' --no-wait
26 changes: 26 additions & 0 deletions .codeanalysis/codeanalysis.ruleset
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="StyleCop and FxCop ruleset" Description="StyleCop and FxCop ruleset" ToolsVersion="15.0">
<IncludeAll Action="Error" />
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1600" Action="None" />
<!-- Partial classes must be documented - project wide we dont document at class level -->
<Rule Id="SA1601" Action="None" />
<Rule Id="SA1602" Action="None" />
<Rule Id="SA1633" Action="None" />
<Rule Id="SA0001" Action="None" />
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1200" Action="None" />
<Rule Id="SA1309" Action="None" />
<Rule Id="SA1413" Action="None" />
<Rule Id="SX1309" Action="Error" />
<Rule Id="SX1101" Action="Error" />
<!-- Do not directly await a task with configure await - this is irrelevant in .NET CORE -->
<Rule Id="CA2007" Action="None" />
<!-- Do not regions - OK to do so for making dividing code into logical sections. -->
<Rule Id="SA1124" Action="None" />
<!-- Static members should appear before non-static members - Alphabetical ordering is fine. -->
<Rule Id="SA1204" Action="None" />
</Rules>
<Rules AnalyzerId="Microsoft.ApiDesignGuidelines.Analyzers" RuleNamespace="Microsoft.ApiDesignGuidelines.Analyzers">
</Rules>
</RuleSet>
9 changes: 9 additions & 0 deletions .codeanalysis/stylecop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Documentation for this file: https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/Configuration.md
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"indentation": {
"useTabs": false
}
}
}
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!build
136 changes: 136 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
repository:
# See https://docs.github.com/en/rest/reference/repos#update-a-repository for all available settings.

# The name of the repository. Changing this will rename the repository
name: SSW.Rewards.Mobile

# A short description of the repository that will show up on GitHub
description:

# A URL with more information about the repository
homepage: https://rewards.ssw.com.au

# A comma-separated list of topics to set on the repository
topics:

# Either `true` to make the repository private, or `false` to make it public.
private: false

# Either `true` to enable issues for this repository, `false` to disable them.
has_issues: true

# Either `true` to enable projects for this repository, or `false` to disable them.
# If projects are disabled for the organization, passing `true` will cause an API error.
has_projects: false

# Either `true` to enable the wiki for this repository, `false` to disable it.
has_wiki: false

# Either `true` to enable downloads for this repository, `false` to disable them.
has_downloads: false

# Updates the default branch for this repository.
default_branch: main

# Either `true` to allow squash-merging pull requests, or `false` to prevent
# squash-merging.
allow_squash_merge: true

# Either `true` to allow merging pull requests with a merge commit, or `false`
# to prevent merging pull requests with merge commits.
allow_merge_commit: false

# Either `true` to allow rebase-merging pull requests, or `false` to prevent
# rebase-merging.
allow_rebase_merge: true

# Either `true` to enable automatic deletion of branches on merge, or `false` to disable
delete_branch_on_merge: true

# Either `true` to enable automated security fixes, or `false` to disable
# automated security fixes.
enable_automated_security_fixes: true

# Either `true` to enable vulnerability alerts, or `false` to disable
# vulnerability alerts.
enable_vulnerability_alerts: true

# Labels: define labels for Issues and Pull Requests
labels:
- name: bug
color: CC0000
description: An issue with the system 🐛.

- name: feature
# If including a `#`, make sure to wrap it with quotes!
color: '#336699'
description: New functionality.

- name: Help Wanted
# Provide a new name to rename an existing label
new_name: first-timers-only

# Milestones: define milestones for Issues and Pull Requests
milestones:
# - title: milestone-title
# description: milestone-description
# # The state of the milestone. Either `open` or `closed`
# state: open

# Collaborators: give specific users access to this repository.
# See https://docs.github.com/en/rest/reference/repos#add-a-repository-collaborator for available options
collaborators:
# - username: bkeepers
# permission: push
# - username: hubot
# permission: pull

# Note: `permission` is only valid on organization-owned repositories.
# The permission to grant the collaborator. Can be one of:
# * `pull` - can pull, but not push to or administer this repository.
# * `push` - can pull and push, but not administer this repository.
# * `admin` - can pull, push and administer this repository.
# * `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions.
# * `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access.

# See https://docs.github.com/en/rest/reference/teams#add-or-update-team-repository-permissions for available options
teams:
# - name: core
# permission: admin
# - name: docs
# permission: push

branches:
- name: main
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
required_pull_request_reviews:
# The number of approvals required. (1-6)
required_approving_review_count: 1
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: true
# Blocks merge until code owners have reviewed.
require_code_owner_reviews: true
# Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions object to disable. User and team dismissal_restrictions are only available for organization-owned repositories. Omit this parameter for personal repositories.
dismissal_restrictions:
users: []
teams: []
# Required. Require status checks to pass before merging. Set to null to disable
required_status_checks:
# Required. Require branches to be up to date before merging.
strict: true
# Required. The list of status checks to require in order to merge into this branch
contexts:
- ci
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
enforce_admins: true
# Prevent merge commits from being pushed to matching branches
required_linear_history: true
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
restrictions:
apps: []
users: []
teams: []
Loading
Loading