-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
212 changed files
with
14,202 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/Templates/BlazorWeb/Bit.BlazorWeb.ProjectTemplate.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="../../Bit.Build.props" /> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<IncludeBuildOutput>false</IncludeBuildOutput> | ||
<ContentTargetFolders>content</ContentTargetFolders> | ||
<EnableDefaultItems>false</EnableDefaultItems> | ||
<NoDefaultExcludes>true</NoDefaultExcludes> | ||
|
||
<!-- Nuget Package--> | ||
<PackageId>Bit.BlazorWeb</PackageId> | ||
<PackageType>Template</PackageType> | ||
<Title>bit BlazorWeb</Title> | ||
<PackageDescription>A template for creating a Todo Web app based on the bit platform</PackageDescription> | ||
<PackageTags>Bit;c#;asp.net;core;template;web;blazor</PackageTags> | ||
<PackageCopyright>Copyright © bit platform 2023</PackageCopyright> | ||
<PackageIcon>bit-icon-512.png</PackageIcon> | ||
|
||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="Bit.BlazorWeb\**" Exclude="Bit.BlazorWeb\.vs\**;Bit.BlazorWeb\**\bin\**\*;Bit.BlazorWeb\**\obj\**\*; " /> | ||
<Compile Remove="**\*" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="Bit.BlazorWeb\src\BlazorWeb.Client\wwwroot\images\icons\bit-icon-512.png"> | ||
<Pack>True</Pack> | ||
<PackagePath>\</PackagePath> | ||
</None> | ||
<None Include="..\..\..\LICENSE"> | ||
<Pack>True</Pack> | ||
<PackagePath>\</PackagePath> | ||
</None> | ||
<None Include="README.md"> | ||
<Pack>True</Pack> | ||
<PackagePath>\</PackagePath> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
137 changes: 137 additions & 0 deletions
137
src/Templates/BlazorWeb/Bit.BlazorWeb/.azure-devops/workflows/cd.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
trigger: | ||
- main | ||
|
||
# https://bitplatform.dev/templates/devops | ||
|
||
variables: | ||
APP_SERVICE_NAME: 'app-service-td-test' | ||
AZURE_SERVICE_CONNECTION: 'td-test-service-connection' # https://learn.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml#azure-resource-manager-service-connection | ||
ConnectionStrings.SqlServerConnectionString: $(DB_CONNECTION_STRING) | ||
AppSettings.JwtSettings.IdentityCertificatePassword: $(API_IDENTITY_CERTIFICATE_PASSWORD) | ||
# ApiServerAddress: 'api/' | ||
# // You can also use absolute urls such as https://todob.bitplatform.dev/api/ | ||
|
||
jobs: | ||
|
||
- job: build_api_blazor | ||
displayName: 'build api + blazor' | ||
|
||
pool: | ||
vmImage: 'ubuntu-22.04' | ||
|
||
steps: | ||
- task: UseDotNet@2 | ||
displayName: 'Setup .NET' | ||
inputs: | ||
useGlobalJson: true | ||
workingDirectory: 'src' | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '18.x' | ||
displayName: 'Install Node.js' | ||
|
||
- task: Bash@3 | ||
displayName: 'Install wasm' | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
'cd src && dotnet workload install wasm-tools wasm-experimental' | ||
- task: FileTransform@1 | ||
displayName: Update appsettings.json | ||
inputs: | ||
fileType: 'json' | ||
folderPath: './' | ||
targetFiles: 'src/BlazorWeb.Client/appsettings.json' | ||
|
||
- task: Bash@3 | ||
displayName: 'Generate CSS/JS files' | ||
inputs: | ||
targetType: 'inline' | ||
script: 'dotnet build src/BlazorWeb.Client/BlazorWeb.Client.csproj -t:BeforeBuildTasks --no-restore' | ||
|
||
- task: Bash@3 | ||
displayName: 'Publish' | ||
inputs: | ||
targetType: 'inline' | ||
script: 'dotnet publish src/BlazorWeb.Server/BlazorWeb.Server.csproj -p:Configuration=Release --self-contained -r linux-x64 -o api-web' | ||
|
||
- task: PublishPipelineArtifact@1 | ||
displayName: Upload api-web artifact | ||
inputs: | ||
targetPath: 'api-web' | ||
artifact: 'api-web-bundle' | ||
publishLocation: 'pipeline' | ||
|
||
- task: Bash@3 | ||
displayName: 'Build migrations bundle' | ||
inputs: | ||
targetType: 'inline' | ||
script: 'cd src/BlazorWeb.Server/ && dotnet tool restore && dotnet ef migrations bundle --self-contained -r linux-x64 --project BlazorWeb.Server.csproj' | ||
|
||
- task: PublishPipelineArtifact@1 | ||
displayName: Upload ef migrations bundle | ||
inputs: | ||
targetPath: 'src/BlazorWeb.Server/efbundle' | ||
artifact: 'migrations-bundle' | ||
publishLocation: 'pipeline' | ||
|
||
- job: deploy_api_blazor | ||
dependsOn: build_api_blazor | ||
displayName: 'deploy api + blazor' | ||
|
||
pool: | ||
vmImage: 'ubuntu-22.04' | ||
|
||
steps: | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
displayName: Retrieve api-web bundle | ||
inputs: | ||
artifact: 'api-web-bundle' | ||
path: ./ | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
displayName: Retrieve migrations bundle | ||
inputs: | ||
artifact: 'migrations-bundle' | ||
path: ./ | ||
|
||
- task: FileTransform@1 | ||
displayName: Update appsettings.json | ||
inputs: | ||
fileType: 'json' | ||
folderPath: './' | ||
targetFiles: 'appsettings.json' | ||
|
||
- task: DownloadSecureFile@1 | ||
displayName: Download .pfx file | ||
name: IdentityCertificate | ||
inputs: | ||
secureFile: 'IdentityCertificate.pfx' | ||
|
||
- script: | | ||
rm IdentityCertificate.pfx | ||
cp "$(IdentityCertificate.secureFilePath)" "IdentityCertificate.pfx" | ||
failOnStderr: true | ||
displayName: Copy .pfx file | ||
- task: Bash@3 | ||
displayName: 'Run migrations' | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
chmod +x efbundle | ||
./efbundle | ||
rm efbundle | ||
failOnStderr: true | ||
|
||
- task: AzureRmWebAppDeployment@4 | ||
displayName: 'Deploy to App Service' | ||
inputs: | ||
ConnectionType: 'AzureRM' | ||
azureSubscription: '$(AZURE_SERVICE_CONNECTION)' | ||
appType: 'webAppLinux' | ||
WebAppName: '$(APP_SERVICE_NAME)' | ||
packageForLinux: '.' |
28 changes: 28 additions & 0 deletions
28
src/Templates/BlazorWeb/Bit.BlazorWeb/.azure-devops/workflows/ci.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
trigger: | ||
- develop | ||
|
||
# https://bitplatform.dev/templates/devops | ||
|
||
- job: build_api_blazor | ||
displayName: 'build api + blazor' | ||
|
||
pool: | ||
vmImage: 'ubuntu-22.04' | ||
|
||
steps: | ||
- task: UseDotNet@2 | ||
displayName: 'Setup .NET' | ||
inputs: | ||
useGlobalJson: true | ||
workingDirectory: 'src' | ||
|
||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '18.x' | ||
displayName: 'Install Node.js' | ||
|
||
- task: Bash@3 | ||
displayName: 'Build' | ||
inputs: | ||
targetType: 'inline' | ||
script: 'dotnet build src/BlazorWeb.Server/BlazorWeb.Server.csproj -p:Configuration=Release' |
Oops, something went wrong.