Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
abbgrade committed Aug 7, 2022
2 parents 050fdd1 + 0b6eb97 commit d2fd075
Show file tree
Hide file tree
Showing 14 changed files with 125 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ on:

jobs:
build-validation:
uses: abbgrade/PsBuildTasks/.github/workflows/build-validation-matrix.yml@v1.1
uses: abbgrade/PsBuildTasks/.github/workflows/build-validation-matrix.yml@1.4.0
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
pre-release:
uses: abbgrade/PsBuildTasks/.github/workflows/pre-release-windows.yml@v1.1
uses: abbgrade/PsBuildTasks/.github/workflows/pre-release-windows.yml@1.4.0
with:
module-name: PsSqlTestServer
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
release:
uses: abbgrade/PsBuildTasks/.github/workflows/release-windows.yml@v1.1
uses: abbgrade/PsBuildTasks/.github/workflows/release-windows.yml@1.4.0
with:
module-name: PsSqlTestServer
secrets:
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.3.0] - 2022-08-07

### Added

- New-AzureInstance, Remove-AzureInstance
- New-AzureInstance, Remove-AzureInstance and New-DatabaseName commands

### Changed

Expand Down
2 changes: 1 addition & 1 deletion docs/New-SqlTestDatabase.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Aliases:

Required: False
Position: 3
Default value: ( [string](New-Guid) ).Substring(0, 8)
Default value: ( New-DatabaseName )
Accept pipeline input: False
Accept wildcard characters: False
```
Expand Down
57 changes: 57 additions & 0 deletions docs/New-SqlTestDatabaseName.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
external help file: PsSqlTestServer-help.xml
Module Name: PsSqlTestServer
online version:
schema: 2.0.0
---

# New-SqlTestDatabaseName

## SYNOPSIS
Generates a database name.

## SYNTAX

```
New-SqlTestDatabaseName [[-Prefix] <String>] [<CommonParameters>]
```

## DESCRIPTION
Generates a short random database name.

## EXAMPLES

### Example 1
```powershell
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -Prefix
Prefix to the database name.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: Test-
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS
2 changes: 1 addition & 1 deletion docs/New-SqlTestLocalInstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Aliases:

Required: False
Position: 1
Default value: "test-$(( [string](New-Guid) ).Substring(0, 8))"
Default value: "test-$( New-DatabaseName )"
Accept pipeline input: False
Accept wildcard characters: False
```
Expand Down
1 change: 0 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
theme: jekyll-theme-minimal
2 changes: 1 addition & 1 deletion src/PsSqlTestServer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PsSqlTestServer.psm1'

# Version number of this module.
ModuleVersion = '1.2.0'
ModuleVersion = '1.3.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
2 changes: 1 addition & 1 deletion src/Public/New-Database.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function New-Database {
# Specifies the name of the database to create.
[Parameter()]
[ValidateNotNullOrEmpty()]
[string] $Name = ( [string](New-Guid) ).Substring(0, 8)
[string] $Name = ( New-DatabaseName )
)

$Database = $Instance.PsObject.Copy()
Expand Down
26 changes: 26 additions & 0 deletions src/Public/New-DatabaseName.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function New-DatabaseName {

<#
.SYNOPSIS
Generates a database name.
.DESCRIPTION
Generates a short random database name.
#>

[CmdletBinding()]
param (
# Prefix to the database name.
[Parameter()]
[string] $Prefix = 'test-'
)

if ( $Prefix ) {
Write-Output "$Prefix$( ( [string](New-Guid) ).Substring(0, 8) )"
} else {
Write-Output ( [string](New-Guid) ).Substring(0, 8)
}

}
2 changes: 1 addition & 1 deletion src/Public/New-LocalInstance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function New-LocalInstance {
# Specifies the name of the instance to create.
[Parameter()]
[ValidateNotNullOrEmpty()]
[string] $Name = "test-$(( [string](New-Guid) ).Substring(0, 8))"
[string] $Name = "test-$( New-DatabaseName )"
)

Import-Module PsSqlLocalDb -ErrorAction Stop
Expand Down
3 changes: 2 additions & 1 deletion tasks/Build.Tasks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ requires ModuleName

# Synopsis: Remove all temporary files.
task Clean -Jobs {
remove $PublishDirectory, $DocumentationDirectory
remove $PublishDirectory
$DocumentationDirectory | Get-ChildItem -Exclude index.md, _config.yml | Remove-item
}

# Synopsis: Import the module.
Expand Down
39 changes: 29 additions & 10 deletions tasks/PsBuild.Tasks.ps1
Original file line number Diff line number Diff line change
@@ -1,47 +1,66 @@

if ( -Not $PsBuildTaskBranch ) {
$PsBuildTaskBranch = 'main'
}

#region InvokeBuild

task UpdateBuildTasks {
Invoke-WebRequest `
-Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/Powershell/Build.Tasks.ps1' `
-Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/Powershell/Build.Tasks.ps1" `
-OutFile "$PSScriptRoot\Build.Tasks.ps1"
}

#endregion
#region GitHub Actions

task UpdateValidationWorkflow {
[System.IO.FileInfo] $file = "$PSScriptRoot/../.github/workflows/build-validation.yml"
New-Item -Type Directory $file.Directory -ErrorAction SilentlyContinue
Invoke-WebRequest `
-Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/GitHub/build-validation-matrix.yml' `
-OutFile "$PSScriptRoot\..\.github\workflows\build-validation.yml"
-Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/GitHub/build-validation-matrix.yml" `
-OutFile $file
}

task UpdatePreReleaseWorkflow {
requires ModuleName
[System.IO.FileInfo] $file = "$PSScriptRoot\..\.github\workflows\pre-release.yml"
New-Item -Type Directory $file.Directory -ErrorAction SilentlyContinue
Invoke-WebRequest `
-Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/GitHub/pre-release-windows.yml' `
-OutFile "$PSScriptRoot\..\.github\workflows\pre-release.yml"
-Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/GitHub/pre-release-windows.yml" |
ForEach-Object { $_ -replace 'MyModuleName', $ModuleName } |
Out-File $file -NoNewline
}

task UpdateReleaseWorkflow {
requires ModuleName
[System.IO.FileInfo] $file = "$PSScriptRoot\..\.github\workflows\release.yml"
New-Item -Type Directory $file.Directory -ErrorAction SilentlyContinue
Invoke-WebRequest `
-Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/GitHub/release-windows.yml' `
-OutFile "$PSScriptRoot\..\.github\workflows\release.yml"
-Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/GitHub/release-windows.yml" |
ForEach-Object { $_ -replace 'MyModuleName', $ModuleName } |
Out-File $file -NoNewline
}

#endregion
#region GitHub Pages

task UpdateIndexPage {
New-Item -Type Directory "$PSScriptRoot\..\docs" -ErrorAction SilentlyContinue
Invoke-WebRequest `
-Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/docs/index.md' `
-Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/docs/index.md" `
-OutFile "$PSScriptRoot\..\docs\index.md"
Invoke-WebRequest `
-Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/docs/_config.yml" `
-OutFile "$PSScriptRoot\..\docs\_config.yml"
}

#endregion
#region VsCode

task UpdateVsCodeTasks {
Invoke-WebRequest `
-Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/VsCode/tasks.json' `
-Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/VsCode/tasks.json" `
-OutFile "$PSScriptRoot\..\.vscode\tasks.json"
}

Expand All @@ -50,7 +69,7 @@ task UpdateVsCodeTasks {

task UpdatePsBuildTasksTasks {
Invoke-WebRequest `
-Uri 'https://raw.githubusercontent.com/abbgrade/PsBuildTasks/main/tasks/PowerShell-Matrix.Tasks.ps1' `
-Uri "https://raw.githubusercontent.com/abbgrade/PsBuildTasks/$PsBuildTaskBranch/tasks/PowerShell-Matrix.Tasks.ps1" `
-OutFile "$PSScriptRoot\PsBuild.Tasks.ps1"
}

Expand Down

0 comments on commit d2fd075

Please sign in to comment.