forked from Azure/batch-shipyard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-cli.ps1
More file actions
21 lines (17 loc) · 936 Bytes
/
build-cli.ps1
File metadata and controls
21 lines (17 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$version = $(python -c 'from convoy import __version__; print(__version__)')
$executableName = "batch-shipyard-${version}-cli-win-amd64.exe"
$gitHash= $(git show --format='%h' --no-patch)
$versionCore = $version.split('-')[0]
$majorVersion, $minorVersion, $patchNumber = $versionCore.split('.')
$buildNumber = 1
$versionTuple = [string]::Format("({0}, {1}, {2}, {3})", $majorVersion, $minorVersion, $patchNumber, $buildNumber)
$branchGitSha1 = "${version}@${gitHash}"
$originalFileVerInfo = 'images\docker\windows\file_version_info.txt'
$fileVersionInfo = 'cli_version_info.txt'
(Get-Content $originalFileVerInfo) `
-replace '{BUILDVER_DOTTED}', $version `
-replace '{BUILDVER_TUPLE}', $versionTuple `
-replace '{BRANCH_GITSHA1}', $branchGitSha1 `
-replace '{EXE}', $executableName `
| Set-Content $fileVersionInfo
$env:ARTIFACT_VERSION=$version; pyinstaller --distpath dist --clean .\shipyard-cli-windows.spec