summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-03-15 12:16:00 -0700
committerTim Smith <tsmith84@gmail.com>2021-03-15 12:23:55 -0700
commitb9b49ea362ff9358c07f1f9fb0e8bac822496e79 (patch)
tree9ab0209aa6b27a83e0cb0054e0d08f657539804e
parentb67455cdf1ac5a8036d37aaaac88dfac6947a04b (diff)
downloadchef-b9b49ea362ff9358c07f1f9fb0e8bac822496e79.tar.gz
Add an expeditor script specific to bundler updated gems
The more I hacked on the previous script the more I realized they're not doing the same thing. This script is not concerned with things that happened via rubygems promotes. It's just running bundle update when a new commit is available in the repo. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--.expeditor/config.yml4
-rwxr-xr-x.expeditor/update_bundler_dep.sh29
2 files changed, 31 insertions, 2 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml
index 7b6b13311c..f87694b89e 100644
--- a/.expeditor/config.yml
+++ b/.expeditor/config.yml
@@ -226,8 +226,8 @@ subscriptions:
# NOTE: The branch of Ohai here needs to be updated when setting up a stable branch of chef/chef
- workload: chef/ohai:master_completed:pull_request_merged:chef/ohai:master:*
actions:
- - bash:.expeditor/update_dep.sh
+ - bash:.expeditor/update_bundler_dep.sh
# NOTE: When the stable branch of chef/chef is being cut you probably want to remove this subscription
- workload: chef/chefstyle:master_completed:pull_request_merged:chef/chefstyle:master:*
actions:
- - bash:.expeditor/update_dep.sh
+ - bash:.expeditor/update_bundler_dep.sh
diff --git a/.expeditor/update_bundler_dep.sh b/.expeditor/update_bundler_dep.sh
new file mode 100755
index 0000000000..e9bdfffe6f
--- /dev/null
+++ b/.expeditor/update_bundler_dep.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+############################################################################
+# What is this script?
+#
+# Chef uses a workflow tool called Expeditor to manage version bumps, changelogs
+# and releases. When a dependency of chef is released, expeditor is triggered
+# against this repository to run this script. It bumps our gem lock files and opens
+# a PR. That way humans can do hard work and bots can open gem bump PRs.
+############################################################################
+
+set -evx
+
+branch="expeditor/$EXPEDITOR_REPO_$EXPEDITOR_LATEST_COMMIT"
+git checkout -b "$branch"
+
+bundle lock --update
+
+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 $DEPNAME to $EXPEDITOR_LATEST_COMMIT" --message "This pull request was triggered automatically via Expeditor when $DEPNAME $EXPEDITOR_LATEST_COMMIT 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 "$EXPEDITOR_BRANCH"
+
+# 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"