-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into im/fix_netlify_config
- Loading branch information
Showing
18 changed files
with
248 additions
and
135 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# This gets run as a pre-commit hook just prior to a merge to | ||
# determine the new version number. | ||
|
||
# Leading zeros are not permitted in strict SemVer | ||
YEAR=`date +"%y" | sed -e 's/^0//'` # Must be < 256 per Microsoft | ||
MONTH=`date +"%m" | sed -e 's/^0//'` | ||
|
||
OLD_BUILD=`cut -f3 -d. < VERSION` | ||
|
||
NEW_BUILD=$(($OLD_BUILD + 1)) # Monotonically increase the build number | ||
|
||
echo $YEAR.$MONTH.$NEW_BUILD > VERSION |
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,44 @@ | ||
$ErrorActionPreference="stop" | ||
|
||
Write-Host "--- Fetching latest release data from omnitruck API" | ||
$Uri = "https://omnitruck.chef.io/stable/chef-workstation/metadata?p=windows&pv=2016&m=x86_64&v=latest" | ||
$releaseRecord = Invoke-RestMethod -Uri $Uri -Headers @{accept="application/json"} -ErrorAction Stop | ||
|
||
Write-Host "--- Copying templates locally" | ||
$tempDir = Join-Path $env:temp ([System.IO.Path]::GetRandomFileName()) | ||
New-Item $tempDir -ItemType Directory -Force | Out-Null | ||
Copy-Item -Path "components/packaging/chocolatey/*" -Destination $tempDir -Recurse | ||
|
||
Write-Host "--- Patching templates" | ||
$files = Get-ChildItem -Path $tempDir -Filter *.* -Recurse | Where-Object {!$_.PSIsContainer} | Select-Object FullName | ||
ForEach ($file in $files) { | ||
(Get-Content $file.FullName). | ||
Replace('$url$', $releaseRecord.url). | ||
Replace('$version$', $releaseRecord.version). | ||
Replace('$checksum$', $releaseRecord.sha256) | | ||
Set-Content $file.FullName | ||
|
||
Write-Host "--- DEBUG - Patched " $file.FullName " follows:" | ||
Get-Content $file.FullName | Write-Host | ||
} | ||
|
||
Write-Host "--- Publishing package" | ||
|
||
$valid_build_creator="Chef Expeditor" | ||
$pack_cmd = "choco pack $tempDir/chef-workstation.nuspec --version " + $releaseRecord.version | ||
$publish_cmd = "choco push chef-workstation." + $releaseRecord.version + ".nupkg --timeout 600" | ||
|
||
try { | ||
if($env:BUILDKITE_BUILD_CREATOR -eq $valid_build_creator) { | ||
Invoke-Expression $pack_cmd | ||
if ($LASTEXITCODE -ne 0) { throw "unable to choco pack" } | ||
Invoke-Expression "$publish_cmd --key $env:CHOCO_API_KEY" | ||
if ($LASTEXITCODE -ne 0) { throw "unable to publish Chocolatey package" } | ||
} else { | ||
Write-Host "--- NOT PUBLISHING: Build triggered by $env:BUILDKITE_BUILD_CREATOR and not $valid_build_creator" | ||
Write-Host $pack_cmd | ||
Write-Host $publish_cmd " --key <elided ChocoApiKey>" | ||
} | ||
} finally { | ||
Remove-Item $tempDir -Recurse -Force | ||
} |
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 |
---|---|---|
@@ -1 +1,14 @@ | ||
# This pipeline is currently under development. | ||
steps: | ||
- label: ":chocolate_bar: Publish Chocolatey package" | ||
command: | ||
- powershell .expeditor/publish_to_chocolatey.ps1 | ||
expeditor: | ||
secrets: | ||
CHOCO_API_KEY: | ||
path: account/static/chocolatey/chef-ci | ||
field: api_key | ||
executor: | ||
docker: | ||
host_os: windows | ||
environment: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.17.27 | ||
20.4.9 |
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
Oops, something went wrong.