Skip to content

Commit

Permalink
Add a script to parse docker desktop version, change brew cask install (
Browse files Browse the repository at this point in the history
ddev#2865)

* Add a script to parse docker desktop version
* Do cask installs the new way
  • Loading branch information
rfay authored Mar 11, 2021
1 parent 28b28c0 commit 2f28b15
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .buildkite/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This script is used to build drud/ddev using buildkite

export PATH=$PATH:/home/linuxbrew/.linuxbrew/bin
echo "--- buildkite building ${BUILDKITE_JOB_ID:-} at $(date) on $(hostname) as USER=${USER} for OS=${OSTYPE} in ${PWD} with golang=$(go version | awk '{print $3}') docker=$(docker --version | awk '{print $3}') and docker-compose $(docker-compose --version | awk '{print $3}') ddev version=$(ddev --version | awk '{print $3}')"
echo "--- buildkite building ${BUILDKITE_JOB_ID:-} at $(date) on $(hostname) as USER=${USER} for OS=${OSTYPE} in ${PWD} with golang=$(go version | awk '{print $3}') docker-desktop=$(scripts/docker-desktop-version.sh) docker=$(docker --version | awk '{print $3}') and docker-compose $(docker-compose --version | awk '{print $3}') ddev version=$(ddev --version | awk '{print $3}')"

export GOTEST_SHORT=1
export DDEV_NONINTERACTIVE=true
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/testbot_maintenance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ os=$(go env GOOS)
if ! command -v ngrok >/dev/null; then
case $os in
darwin)
brew cask install ngrok
brew install homebrew/cask/ngrok
;;
windows)
choco install -y ngrok
Expand All @@ -22,7 +22,7 @@ fi
# Upgrade various items on various operating systems
case $os in
darwin)
for item in mkcert mkdocs golang golangci-lint ddev; do
for item in ddev golang golangci-lint mkcert mkdocs python3-yq; do
brew upgrade $item || brew install $item || true
done
;;
Expand Down
4 changes: 2 additions & 2 deletions .circleci/macos_circle_vm_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export HOMEBREW_NO_INSTALL_CLEANUP=1
sudo /Applications/Docker.app/Contents/MacOS/Docker --quit-after-install --unattended
nohup /Applications/Docker.app/Contents/MacOS/Docker --unattended &

brew cask install ngrok >/dev/null
brew tap drud/ddev >/dev/null
brew install homebrew/cask/ngrok >/dev/null
brew install drud/ddev/ddev >/dev/null
brew unlink python@2 >/dev/null || true

brew install mysql-client zip makensis jq expect coreutils golang ddev mkcert osslsigncode ghr gnu-getopt libgsf glib pcre >/dev/null || true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/selfhosted-upgrades.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ os=$(go env GOOS)
if ! command -v ngrok >/dev/null; then
case $os in
darwin)
brew cask install ngrok
brew install homebrew/cask/ngrok
;;
windows)
choco install -y ngrok
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/buildkite-testmachine-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ We are using [Buildkite](https://buildkite.com/drud) for Windows and macOS testi
1. Create the user "testbot" on the machine. The password should be the password of [email protected].
2. Change the name of the machine to something in keeping with current style. Maybe `testbot-macstadium-macos-3`.
3. Install [Homebrew](https://brew.sh/) `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
4. Install golang/git/docker with `brew tap drud/ddev-edge && brew install buildkite/buildkite/buildkite-agent iterm2 google-chrome docker nosleep golang git mariadb jq p7zip bats-core composer ddev netcat mkcert ngrok`
4. Install golang/git/docker with brew install buildkite/buildkite/buildkite-agent homebrew/cask/iterm2 homebrew/cask/google-chrome homebrew/cask/docker homebrew/cask/nosleep golang git mariadb jq p7zip bats-core composer drud/ddev/ddev netcat mkcert homebrew/cask/ngrok`
5. `mkcert -install`
6. Run Docker manually and go through its configuration routine.
7. Run iTerm. On Mojave and higher it may prompt for requiring full disk access permissions, follow through with that.
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/github-selfhosted-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ We are using GitHub Self-Hosted Agents for Windows and macOS testing. The build
1. Create the user "testbot" on the machine. The password should be the password of [email protected].
2. Change the name of the machine to something in keeping with current style. Maybe `testbot-macstadium-macos-3`.
3. Install [Homebrew](https://brew.sh/) `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
4. Install golang/git/docker with `brew cask install iterm2 google-chrome docker nosleep && brew tap buildkite/buildkite && brew tap drud/ddev && brew install golang git buildkite-agent mariadb jq p7zip bats-core composer ddev netcat mkcert && brew cask install ngrok`
4. Install golang/git/docker with `brew install homebrew/cask/iterm2 homebrew/cask/google-chrome homebrew/cask/docker drud/ddev/ddev homebrew/cask/nosleep buildkite/buildkite/buildkite-agent golang git mariadb jq p7zip bats-core composer netcat mkcert homebrew/cask/ngrok`
5. `mkcert -install`
6. Run Docker manually and go through its configuration routine.
7. Run iTerm. On Mojave and higher it may prompt for requiring full disk access permissions, follow through with that.
Expand Down
19 changes: 19 additions & 0 deletions scripts/docker-desktop-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

MACOS_INFO_PATH=/Applications/Docker.app/Contents/Info.plist

if [ "${OSTYPE%%[0-9]*}" = "darwin" ] && ! command -v xq >/dev/null; then
printf "Please install xq, brew install python-yq, to parse macOS Info.plist"
exit
fi

if command -v powershell >/dev/null; then
printf "Docker Desktop for Windows "
powershell.exe -command '[System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files\Docker\Docker\Docker Desktop.exe").FileVersion'
elif [ -x /usr/libexec/PlistBuddy ] ; then
version=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ${MACOS_INFO_PATH})
build=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" ${MACOS_INFO_PATH})
printf "Docker Desktop for Mac %s build %s" ${version} ${build}
else
printf "Unknown Docker Desktop version"
fi
2 changes: 2 additions & 0 deletions scripts/test_ddev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# `ddev config global --nfs-mount-enabled=false`

PROJECT_NAME=tryddevproject-${RANDOM}
BASEDIR=$(dirname "$0")

function cleanup {
printf "\nPlease delete this project after debugging with 'ddev delete -Oy ${PROJECT_NAME}'\n"
Expand All @@ -18,6 +19,7 @@ trap cleanup EXIT
uname -a
ddev version
ls -l "$(which docker)"
${BASEDIR}/docker-desktop-version.sh && echo
ddev poweroff
docker ps -a
docker run -it --rm busybox ls
Expand Down

0 comments on commit 2f28b15

Please sign in to comment.