-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathdo_renovate_post_upgrade
executable file
·47 lines (38 loc) · 1.4 KB
/
do_renovate_post_upgrade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
# This script is called by Renovate as a post-upgrade task. It installs
# Bazelisk and then executes tidy in workspaces that have modifications from
# the Renovate upgrade process.
set -o errexit -o nounset -o pipefail
# DEBUG BEGIN
echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") START ==============="
# DEBUG END
# Install Bazelisk, if not found
if which &>/dev/null bazelisk; then
echo "Bazelisk was found."
bazelisk="bazelisk"
else
echo "Bazelisk was not found. Installing..."
npm install -g @bazel/bazelisk
npm_root="$(npm root -g)"
bazelisk="${npm_root}/@bazel/bazelisk/bazelisk-linux_amd64"
fi
# Install build tools
if which &>/dev/null clang; then
echo "clang was found."
else
echo "clang was not found. Installing build-essential..."
# install-tool clang 12.0.0
install-tool clang-12 12.0.0
fi
# Execute tidy for workspaces with modifications The export of CC and the
# --action_env=PATH are specific to running this repository on Linux.
export CC=clang
"${bazelisk}" run --action_env=PATH //:tidy_modified
# DEBUG BEGIN
echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") Start //:update_swift_packages_for_modified"
# DEBUG END
# Execute swift package update on modified workspaces.
"${bazelisk}" run --action_env=PATH //:update_swift_packages_for_modified
# DEBUG BEGIN
echo >&2 "*** CHUCK $(basename "${BASH_SOURCE[0]}") End //:update_swift_packages_for_modified"
# DEBUG END