-
Notifications
You must be signed in to change notification settings - Fork 7
Add vagrant init guide script #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
exit 0 | ||
fi | ||
|
||
if [[ "$WE_ARE_IN_CHINA" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we know that we are in China? And, users in other regions around the world might also need to use their local mirrors. How about we don't care if users are specifically in China, but support mirrors by downloading with axel
other than wget
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did tried to use axel --search
, it turned out that the axel relied filesearching.com
can't be accessed in China.
I also want to give multiple urls to axels, but, it seems we can't enumerate the box's mirrors, really, vagrant do not have so many well-known official mirrors like other software.
Plus the fact we have to consider how to install axel itself in kinds of OS, I decided to make it work first, just use the wget
.
Especially for China, I add a param inchina
. Actually, if this param is not present, the script just run vagrant up
and delegate the work to standard vagrant provision process.
./install.bash inchina
Other thought:
I want to make the install more intelligent, so I tried to figure out if we are in China automatically. I found this tool. I will try it in a more standard environment (in the vm, we don't have to consider the os) but not in this install script. It will in my next PR.
echo "Download ubuntu box beforehand..." | ||
mkdir -p downloads | ||
# try with https://mirrors.ustc.edu.cn/ if below not work | ||
wget -c -nv --show-progress -O downloads/ubuntu-bionic64.box "https://mirrors.ustc.edu.cn/ubuntu-cloud-images/bionic/current/bionic-server-cloudimg-amd64-vagrant.box" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script might run on macOS, Windows, and Linux, right? It needs the way to install axel.
- macOS:
- install Homebrew
- install axel, VirtualBox, and Vagrant using Homebrew
- Windows:
- install Chocolatey
- install axel, VirtualBox, and Vagrant using Chocolatey
- Debian-like Linux:
- update apt-get
- install axel, VirtualBox, and Vagrant using apt-get
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like described above, now, I'm focused on macOS and Linux, especially for Chinese developers. Currently, make the provision progress fast takes a higher priority. Maybe I can fix this up in future PRs.
Fixes #14 to make init things easier in China.