Skip to content

Commit

Permalink
Subscribe to Workstation App pr merges
Browse files Browse the repository at this point in the history
This change attempts to subscribe to merge events
on chef/chef-workstation-app and use that to manage
our dependency on the project.

Signed-off-by: Jon Morrow <jmorrow@chef.io>
  • Loading branch information
Jon Morrow committed Oct 10, 2018
1 parent 425aa45 commit f338378
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .expeditor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ subscriptions:
- workload: artifact_published:stable:chefdk:3*
actions:
- bash:.expeditor/update_chefdk_to_stable.sh
- workload: pull_request_merged:chef/chef-workstation-app:master:*
actions:
- bash:.expeditor/update_chef-workstation-app_to_latest.sh
32 changes: 32 additions & 0 deletions .expeditor/update_chef-workstation-app_to_latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

############################################################################
# What is this script?
#
# Chef Workstation uses Expeditor to manage the bundled version of the
# Chef Workstation App. Currently we always want to include the latest version
# of Chef Workstation App inside Workstation, so this script takes that version
# and uses sed to insert it into the omnibus project definition. Then it commits
# that change and opens a pull request for review and merge.
############################################################################

set -evx

version=$(get_github_file $SCM_SETTINGS_GITHUB_REPO master VERSION)

branch="expeditor/chef_workstation_app_${version}"
git checkout -b "$branch"

sed -i -r "s/override :\"chef-workstation-app\",\s+version: \"v[^\"]+\"/override :\"chef-workstation-app\", version: \"v${version}\"/" omnibus/config/projects/chef-workstation.rb

git add .

# give a friendly message for the commit and make sure it's noted for any future audit of our codebase that no
# DCO sign-off is needed for this sort of PR since it contains no intellectual property
git commit --message "Bump Chef Workstation App to $version" --message "This pull request was triggered automatically via Expeditor when Chef Workstation App $version was merged." --message "This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required."

open_pull_request

# Get back to master and cleanup the leftovers - any changed files left over at the end of this script will get committed to master.
git checkout -
git branch -D "$branch"
6 changes: 6 additions & 0 deletions omnibus/config/projects/chef-workstation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@

override :"chef-dk", version: "v3.3.23"

# The Chef Workstation App version is pinned by Expeditor. Whenever Chef Workstation
# App is merged then Expeditor takes the latest tag, runs a script to replace it here
# and pushes a new commit / build through.

override :"chef-workstation-app", version: "v3.3.23"

# DK's overrides; god have mercy on my soul
# This comes from DK's ./omnibus_overrides.rb
# If this stays, may need to duplicate that file and the rake
Expand Down

0 comments on commit f338378

Please sign in to comment.