Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ LABEL maintainer="Microsoft" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.docker.cmd="docker run -it microsoft/sqlcmd:$PACKAGE_VERSION"


COPY ./sqlcmd /usr/bin/sqlcmd

CMD ["sqlcmd"]
82 changes: 81 additions & 1 deletion build/azure-pipelines/package-common-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ steps:
Write-Host("##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG")
Write-Host($VERSION_TAG)
- task: CmdLine@2
condition: ne(variables.OS, 'windows')
displayName: 'Build ${{ parameters.OS }}/${{ parameters.Type }} distribution'
inputs:
script: release/${{ parameters.OS }}/${{ parameters.Type }}/pipeline.sh
Expand All @@ -31,8 +32,87 @@ steps:
CLI_VERSION: $(VERSION_TAG)
BUILD_OUTPUT: $(Pipeline.Workspace)
BUILD_STAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
- task: VSBuild@1
condition: eq(variables.OS, 'windows')
displayName: 'Build Windows MSI distribution'
inputs:
solution: '$(Build.SourcesCliDirectory)\release\windows\msi\sqlcmd.wixproj'
msbuildArchitecture: 'x86'
msbuildArgs: '/p:Configuration=Release'
env:
CLI_VERSION: $(VERSION_TAG)
- task: EsrpCodeSigning@1
condition: eq(variables.OS, 'windows')
inputs:
ConnectedServiceName: 'Code Signing'
FolderPath: '$(Build.SourcesDirectory)/release/windows/msi/bin/Release'
Pattern: '*.msi'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Sqlcmd Tools"
},
{
"parameterName": "OpusInfo",
"parameterValue": "https://github.com/microsoft/go-sqlcmd"
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd sha256"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [
{
"parameterName": "VerifyAll",
"parameterValue": "/all"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
SessionTimeout: '600'
MaxConcurrency: '50'
MaxRetryAttempts: '20'
- task: Bash@3
condition: eq(variables.OS, 'windows')
displayName: 'Rename MSI'
inputs:
targetType: 'inline'
script: |
mv "$(Build.SourcesDirectory)/release/windows/msi/bin/Release/sqlcmd.msi" "$(Build.SourcesDirectory)/release/windows/msi/bin/Release/sqlcmd_${CLI_VERSION}-${CLI_VERSION_REVISION}.msi"
env:
CLI_VERSION: $(VERSION_TAG)
CLI_VERSION_REVISION: 1
- task: CopyFiles@2
condition: eq(variables.OS, 'windows')
displayName: 'Copy MSI to: $(Build.ArtifactStagingDirectory)'
inputs:
sourceFolder: $(Build.SourcesDirectory)/release/windows/msi/bin/Release
contents: '?(*.msi|*.md)'
TargetFolder: $(Build.ArtifactStagingDirectory)
- task: EsrpCodeSigning@1
condition: ne(variables.Type, 'docker')
condition: and(eq(variables.OS, 'linux'), ne(variables.Type, 'docker'))
inputs:
ConnectedServiceName: 'Code Signing'
FolderPath: $(Build.ArtifactStagingDirectory)
Expand Down
13 changes: 12 additions & 1 deletion build/azure-pipelines/package-common-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,21 @@ steps:
Write-Host("##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG")
Write-Host($VERSION_TAG)
- task: CmdLine@2
displayName: 'Test ${{ parameters.OS }}/${{ parameters.Type }} distribution'
condition: ne(variables.OS, 'windows')
displayName: 'Test ${{ parameters.OS }}/${{ parameters.Type }} package'
inputs:
script: release/${{ parameters.OS }}/${{ parameters.Type }}/pipeline-test.sh
workingDirectory: $(Build.SourcesCliDirectory)
env:
CLI_VERSION: $(VERSION_TAG)
BUILD_STAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
- task: PowerShell@2
condition: eq(variables.OS, 'windows')
displayName: 'Test ${{ parameters.OS }}/${{ parameters.Type }} package'
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)\release\windows\msi\scripts\pipeline-test.ps1'
failOnStderr: true
env:
CLI_VERSION: $(VERSION_TAG)

5 changes: 5 additions & 0 deletions build/azure-pipelines/package-product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pr: none

variables:
Build.SourcesCliDirectory: '$(Build.SourcesDirectory)/'
MSI_OUTPUT_DIR: '$(Build.SourcesCliDirectory)/output'

stages:
- stage: CreatePackages
Expand All @@ -26,6 +27,10 @@ stages:
imageName: 'ubuntu-latest'
os: linux
type: docker
windows:
imageName: 'windows-2019'
os: windows
type: msi
pool:
vmImage: $(imageName)
steps:
Expand Down
41 changes: 41 additions & 0 deletions release/windows/msi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Windows MSI

This document provides instructions on creating the MSI.

## Prerequisites

1. WIX Toolset
2. Turn on the '.NET Framework 3.5' Windows Feature (required for WIX Toolset)
3. Install [WIX Toolset build tools](http://wixtoolset.org/releases/) if not already installed
4. Install [Microsoft Build Tools](https://www.microsoft.com/en-us/download/details.aspx?id=48159)

## Building

1. Set the `CLI_VERSION` environment variable
2. Run `release\windows\msi\scripts\pipeline.cmd`
3. The unsigned MSI will be in the `.\output\msi` folder

> **Note:** For `building step 1.` above set both env-vars to the same version-tag for the immediate, this will consolidated in the future.

## Release Install/Update/Uninstall Steps

> **Note:** Replace `{{HOST}}` and `{{CLI_VERSION}}` with the appropriate values.

### Install `Sqlcmd Tools` on Windows

The MSI distributable is used for installing or updating the `Sqlcmd Tools` CLI on Windows.

[Download the MSI Installer](http://{{HOST}}/sqlcmd-{{CLI_VERSION}}.msi)

When the installer asks if it can make changes to your computer, click the `Yes` box.

### Uninstall

You can uninstall the `SqlCmd Tools` from the Windows _Apps and Features_ list. To uninstall:

| Platform | Instructions |
| ------------- |--------------------------------------------------------|
| Windows 10 | Start > Settings > Apps |
| Windows 8 | Start > Control Panel > Programs > Uninstall a program |

The program to uninstall is listed as **Sqlcmd Tools** . Select this application, then click the `Uninstall` button.
Loading