Skip to content

Commit

Permalink
Merge branch 'master' into im/fix_netlify_config
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-ball authored Apr 28, 2020
2 parents b8bf702 + e452f6d commit 94a303b
Show file tree
Hide file tree
Showing 18 changed files with 248 additions and 135 deletions.
13 changes: 5 additions & 8 deletions .expeditor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@ docker_images:
github:
# This deletes the GitHub PR branch after successfully merged into the release branch
delete_branch_on_merge: true
# allow bumping the minor release via label
minor_bump_labels:
- "Expeditor: Bump Version Minor"
# allow bumping the major release via label
major_bump_labels:
- "Expeditor: Bump Version Major"
# https://expeditor.chef.io/docs/getting-started/subscriptions/#merge-actions
# The `merge_actions` key is a shortcut for the
# `pull_request_merged:<GITHUB_REPO>:<RELEASE_BRANCH>:*` subscription.
merge_actions:
- built_in:bump_version:
- bash:.expeditor/determine_version.sh:
ignore_labels:
- "Expeditor: Skip Version Bump"
- "Expeditor: Skip All"
Expand All @@ -36,7 +30,7 @@ merge_actions:
ignore_labels:
- "Expeditor: Skip Omnibus"
- "Expeditor: Skip All"
only_if: built_in:bump_version
only_if: bash:.expeditor/determine_version.sh

pipelines:
- verify:
Expand Down Expand Up @@ -64,6 +58,9 @@ subscriptions:
- bash:.expeditor/purge-cdn.sh
- bash:.expeditor/announce-release.sh
- built_in:tag_docker_image
# publish to third party package managers that have a dependency
# on this artifact's availability
- trigger_pipeline:third-party-packages

- workload: chef/chef-workstation-app:master_completed:pull_request_merged:chef/chef-workstation-app:master:*
actions:
Expand Down
14 changes: 14 additions & 0 deletions .expeditor/determine_version.sh
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
44 changes: 44 additions & 0 deletions .expeditor/publish_to_chocolatey.ps1
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
}
15 changes: 14 additions & 1 deletion .expeditor/third-party-packages.pipeline.yml
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:

15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
<!-- usage documentation: https://expeditor.chef.io/docs/reference/changelog/ -->
<!-- latest_release 0.17.27 -->
## [0.17.27](https://github.com/chef/chef-workstation/tree/0.17.27) (2020-04-21)
<!-- latest_release 20.4.9 -->
## [20.4.9](https://github.com/chef/chef-workstation/tree/20.4.9) (2020-04-28)

#### Merged Pull Requests
- Add empty third party pkg pipeline to expeditor [#1108](https://github.com/chef/chef-workstation/pull/1108) ([marcparadise](https://github.com/marcparadise))
- Pin bcrypt_pbkdf to rc version, bump gems [#1130](https://github.com/chef/chef-workstation/pull/1130) ([clintoncwolfe](https://github.com/clintoncwolfe))
<!-- latest_release -->

<!-- release_rollup since=0.17.5 -->
### Changes since 0.17.5 release

#### Merged Pull Requests
- Pin bcrypt_pbkdf to rc version, bump gems [#1130](https://github.com/chef/chef-workstation/pull/1130) ([clintoncwolfe](https://github.com/clintoncwolfe)) <!-- 20.4.9 -->
- Im/standardize hugo content [#1102](https://github.com/chef/chef-workstation/pull/1102) ([IanMadd](https://github.com/IanMadd)) <!-- 20.4.8 -->
- Update git-custom-bindir to 2.26.2 [#1124](https://github.com/chef/chef-workstation/pull/1124) ([clintoncwolfe](https://github.com/clintoncwolfe)) <!-- 20.4.7 -->
- Update Cookstyle to 6.3 / Chefstyle to 1.0 [#1061](https://github.com/chef/chef-workstation/pull/1061) ([tas50](https://github.com/tas50)) <!-- 20.4.6 -->
- Unpinning train for upcoming major version release [#1111](https://github.com/chef/chef-workstation/pull/1111) ([tyler-ball](https://github.com/tyler-ball)) <!-- 20.4.5 -->
- Bump omnibus-software from `eb8812b` to `5f57d0a` in /omnibus [#1125](https://github.com/chef/chef-workstation/pull/1125) ([dependabot-preview[bot]](https://github.com/dependabot-preview[bot])) <!-- 20.4.4 -->
- Forgot to perform release build on version bump [#1127](https://github.com/chef/chef-workstation/pull/1127) ([tyler-ball](https://github.com/tyler-ball)) <!-- 20.4.3 -->
- Switching to date based versioning [#1112](https://github.com/chef/chef-workstation/pull/1112) ([tyler-ball](https://github.com/tyler-ball)) <!-- 20.4.2 -->
- Manually building and installing docker-api gem [#1122](https://github.com/chef/chef-workstation/pull/1122) ([tyler-ball](https://github.com/tyler-ball)) <!-- 0.17.28 -->
- Add empty third party pkg pipeline to expeditor [#1108](https://github.com/chef/chef-workstation/pull/1108) ([marcparadise](https://github.com/marcparadise)) <!-- 0.17.27 -->
- Add missing node options for policyfiles [#1091](https://github.com/chef/chef-workstation/pull/1091) ([jmassardo](https://github.com/jmassardo)) <!-- 0.17.26 -->
- Clarify Windows requirements [#1089](https://github.com/chef/chef-workstation/pull/1089) ([jmassardo](https://github.com/jmassardo)) <!-- 0.17.25 -->
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL maintainer="Chef Software, Inc. <docker@chef.io>"
ARG EXPEDITOR_CHANNEL
ARG CHANNEL=stable
ARG EXPEDITOR_VERSION
ARG VERSION=0.17.5
ARG VERSION=20.4.1
ENV DEBIAN_FRONTEND=noninteractive \
PATH=/opt/chef-workstation/bin:/opt/chef-workstation/embedded/bin:/root/.chefdk/gem/ruby/2.6.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.17.27
20.4.9
15 changes: 7 additions & 8 deletions components/gems/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ group(:omnibus_package, :development, :test) do
gem "pry"
gem "yard"
gem "guard"
gem "cookstyle", "~> 5.20"
gem "cookstyle", "~> 6.0"
gem "foodcritic", ">= 16.2"
gem "ffi-libarchive"
end
Expand All @@ -44,10 +44,6 @@ end
group(:omnibus_package) do
gem "appbundler"

## Until we resolve https://github.com/inspec/train/issues/548
gem "train", "=3.2.0"
gem "train-core", "=3.2.0"

# Expeditor manages the version of chef released to Rubygems. We only release 'stable' chef
# gems to Rubygems now, so letting this float on latest should always give us the latest
# stable release. May have to re-pin around major version bumping time, or during patch
Expand All @@ -72,8 +68,11 @@ group(:omnibus_package) do
gem "kitchen-digitalocean", ">= 0.10.0"
gem "kitchen-dokken", ">= 2.8.1"
# docker-api appears to be unmaintained, and has a noisy deprecation
# warning under ruby 2.7. Use a local fork. Dependency of kitchen-dokken.
gem "docker-api", git: "https://github.com/chef/docker-api.git"
# warning under ruby 2.7. Using a fork via an omnibus software def.
# Must use the software def because the ruby cleanup deletes the
# bundled gem. Chef Infra Client does not have this issue with Ohai
# and I do not understand why.
gem "docker-api" # , git: "https://github.com/chef/docker-api.git", branch: "master"
gem "kitchen-google", ">= 2.0.0"
gem "kitchen-hyperv", ">= 0.5.1"
gem "kitchen-inspec", ">= 1.0"
Expand All @@ -94,7 +93,7 @@ group(:omnibus_package) do

# ed25519 ssh key support done here as it's a native gem we can't put in train
gem "ed25519"
gem "bcrypt_pbkdf"
gem "bcrypt_pbkdf", ">= 1.1.0.rc1"
gem "chef-cli", ">= 1.0.9"
gem "chef-apply", ">= 0.4.13"

Expand Down
Loading

0 comments on commit 94a303b

Please sign in to comment.