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
# $(siteName) variable must be unique. I recommend using the PR Number in it | |
$parsedSite = (Get-Content "c:\sites.xml" -raw) -replace "\[SiteName\]","$(siteName)" | |
$parsedSite | Set-Content "c:\sites.xml" | |
$parsedAppPool = (Get-Content "c:\apppool.xml" -raw) -replace "\[SiteName\]","$(siteName)" | |
$parsedAppPool | Set-Content "c:\apppool.xml" |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<appcmd> | |
<APPPOOL APPPOOL.NAME="[SiteName]" PipelineMode="Integrated" RuntimeVersion="" state="Started"> | |
<add name="[SiteName]" managedRuntimeVersion=""> | |
<processModel identityType="SpecificUser" userName="user" password="password" /> | |
</add> | |
</APPPOOL> | |
</appcmd> |
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
appcmd list apppool TemplateAppPool /config /xml > c:\apppools.xml | |
appcmd list site TemplateSite /config /xml > c:\sites.xml |
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
appcmd add apppool /name:MyAppPool | |
appcmd add site /name:MySite /bindings:"https/mysite.lpains.com:443:" /physicalPath:"C:\inetpub\wwwroot\MySite" /applicationPool:"MyAppPool" |
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
Import-Module SQLServer | |
# This will check if the DB already exists, if it does, skip the restore | |
# $DbName variable will be based on your PR number | |
# The SourceDb is used to rename the original SQL Server files to something unique using the PR number | |
# This script is using a server share for .bak files. You may change this and have a backup file ready in your SQL Server instead. | |
Invoke-Sqlcmd -ServerInstance MySQLServer -database master -query "IF(DB_ID('$(DbName)') IS NULL) exec spRestorePRBackup @TargetName = '$(DbName)', @SourceDb = 'MyAppDB', @Path = '\\MyServerShare\dbbackup\PR.BAK'" |
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
jobs: | |
- job: | |
displayName: 'Create Database' | |
pool: | |
name: bld-rel | |
variables: | |
DbServer: 'LPainsDB' | |
DbName: 'lpains$(prName)' | |
ConnectionString: 'server=$(DbServer);database=$(DbName);integrated security=sspi;' | |
steps: |
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
jobs: | |
- job: | |
displayName: front-end | |
pool: | |
vmImage: 'windows-2019' | |
steps: | |
- task: Npm@1 | |
displayName: 'npm install' | |
inputs: |
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
trigger: | |
- master | |
pr: | |
- master | |
# You can name your build whichever way you see fit, however, below format will yield the build name as a date like 2021.09.01.1 which can also be used for version numbers. | |
name: $(Date:yyyy.MM.dd)$(Rev:.r) | |
stages: |
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
const regex = /\b(ALTER|CREATE|DELETE [a-z0-9]+|DROP|EXEC|EXECUTE|INSERT INTO [a-z0-9]+|SELECT .+ INTO [a-z0-9]+|MERGE [a-z0-9]+|UPDATE [a-z0-9]+)\b/ig | |
regex.test("select id from tbl") // return false | |
regex.test("select id into tbl2 from tbl") // return true | |
regex.test("INSERT INTO tbl (id) values (1)"); // returns true | |
regex.test("INSERT INTO @tbl (id) values (1)"); // returns false | |
regex.test("update tbl set id = 2 where id = 1"); // return true |
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
... | |
public ObservableCollection<CategoryModel> Categories { get; } = new ObservableCollection<CategoryModel>(); | |
public ObservableCollection<object> SelectedCategories { get; } = new ObservableCollection<object>(); | |
... |