-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestbot_maintenance.sh
executable file
·41 lines (34 loc) · 1.17 KB
/
testbot_maintenance.sh
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
#!/bin/bash
set -eu
os=$(go env GOOS)
# Install ngrok if it's not there.
if ! command -v ngrok >/dev/null; then
case $os in
darwin)
brew cask install ngrok
;;
windows)
choco install -y ngrok
;;
linux)
curl -sSL --fail -o /tmp/ngrok.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip && sudo unzip -o -d /usr/local/bin /tmp/ngrok.zip
;;
esac
fi
# Upgrade various items on various operating systems
case $os in
darwin)
for item in mkcert mkdocs golang golangci-lint ddev; do
brew upgrade $item || brew install $item || true
done
;;
windows)
choco upgrade -y golang nodejs markdownlint-cli mkcert mkdocs || true
;;
esac
yes | ddev delete images
# Remove any -built images, as we want to make sure tests do the building.
docker rmi -f $(docker images --filter "dangling=true" -q --no-trunc) >/dev/null || true
docker rmi -f $(docker images | awk '/drud.*-built/ {print $3}' ) >/dev/null || true
# Make sure the global internet detection timeout is not set to 0 (broken)
perl -pi -e 's/^internet_detection_timeout_ms:.*$/internet_detection_timeout_ms: 750/g' ~/.ddev/global_config.yaml