Skip to content

Conversation

lhw362950217
Copy link
Collaborator

@lhw362950217 lhw362950217 commented May 21, 2020

Fixes #14 to make init things easier in China.

exit 0
fi

if [[ "$WE_ARE_IN_CHINA" ]]; then
Copy link
Collaborator

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?

Copy link
Collaborator Author

@lhw362950217 lhw362950217 May 22, 2020

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"
Copy link
Collaborator

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:
    1. install Homebrew
    2. install axel, VirtualBox, and Vagrant using Homebrew
  • Windows:
    1. install Chocolatey
    2. install axel, VirtualBox, and Vagrant using Chocolatey
  • Debian-like Linux:
    1. update apt-get
    2. install axel, VirtualBox, and Vagrant using apt-get

Copy link
Collaborator Author

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.

@lhw362950217 lhw362950217 merged commit 215ae2e into master May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide vagrant init guide script.
2 participants