Last active
December 2, 2020 17:27
-
-
Save rfay/361c4e1df165774a5262268ef6768884 to your computer and use it in GitHub Desktop.
testddev.sh - simple way to see if ddev is working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Please run this script with "bash testddev.sh" | |
# You can copy and paste it (make a file named testddev.sh) | |
# Or use curl or wget to download the *raw* version. | |
# If you're on Windows (not WSL2) please run it in a git-bash window | |
# When you are reporting an issue, please include the full output of this script. | |
# If you have NFS enabled globally, please temporarily disable it with | |
# `ddev config global --nfs-mount-enabled=false` | |
PROJECT_NAME=tryddevproject | |
function cleanup { | |
printf "\nPlease delete this project after debugging with 'ddev delete -Oy ${PROJECT_NAME}'\n" | |
} | |
trap cleanup EXIT | |
set -x | |
uname -a | |
ddev --version | |
ddev version | |
ls -l "$(which docker)" | |
docker version | |
ddev poweroff | |
docker ps -a | |
docker run -it --rm busybox ls | |
mkdir -p ~/tmp/${PROJECT_NAME} && cd ~/tmp/${PROJECT_NAME} | |
printf "<?php\nprint 'ddev is working. You will want to delete this project with \"ddev delete -Oy ${PROJECT_NAME}\"';\n" >index.php | |
ddev config --project-type=php | |
ddev start || ( \ | |
set +x && \ | |
ddev list && \ | |
printf "========= web container healthcheck ======\n" && \ | |
docker inspect --format "{{json .State.Health }}" ddev-${PROJECT_NAME}-web && \ | |
printf "============= ddev-router healthcheck =========\n" && \ | |
docker inspect --format "{{json .State.Health }}" ddev-router && \ | |
ddev logs >logs.txt && \ | |
printf "Start failed. Please provide this output and the contents of ~/tmp/${PROJECT_NAME}/logs.txt in a gist at gist.github.com\n" && \ | |
exit 1 ) | |
ddev launch | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment