Move provision.py under tools/.

This commit is contained in:
Tim Abbott 2016-06-27 14:50:38 -07:00
parent e1860e5b46
commit beb8b50623
7 changed files with 20 additions and 18 deletions

View File

@ -277,7 +277,7 @@ does the following:
- configures this virtual machine/container for use with Zulip,
- creates a shared directory mapping your clone of the Zulip code inside the
virtual machine/container at `/srv/zulip`
- runs the `provision.py` script inside the virtual machine/container, which
- runs the `tools/provision.py` script inside the virtual machine/container, which
downloads all required dependencies, sets up the python environment for
the Zulip dev environment, and initializes a default test database.
@ -436,7 +436,7 @@ is likely because we've recently merged changes to the development
environment provisioning process that you need to apply to your
development environmnet. To update your environment, you'll need to
re-provision your vagrant machine using `vagrant reload --provision`
(or just `python provision.py` from `/srv/zulip` inside the Vagrant
(or just `python tools/provision.py` from `/srv/zulip` inside the Vagrant
guest); this should be pretty fast and we're working to make it faster.
See also the documentation on the [testing
@ -634,16 +634,16 @@ this post](http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-
#### npm install error
The `provision.py` script may encounter an error related to `npm install`
The `tools/provision.py` script may encounter an error related to `npm install`
that looks something like:
```
==> default: + npm install
==> default: Traceback (most recent call last):
==> default: File "/srv/zulip/provision.py", line 195, in <module>
==> default: File "/srv/zulip/tools/provision.py", line 195, in <module>
==> default:
==> default: sys.exit(main())
==> default: File "/srv/zulip/provision.py", line 191, in main
==> default: File "/srv/zulip/tools/provision.py", line 191, in main
==> default:
==> default: run(["npm", "install"])
==> default: File "/srv/zulip/zulip_tools.py", line 78, in run
@ -848,7 +848,7 @@ running:
```
sudo apt-get update
python /srv/zulip/provision.py
python /srv/zulip/tools/provision.py
cd /srv/zulip
source /srv/zulip-venv/bin/activate
@ -1176,7 +1176,7 @@ Now you're going to install Zulip dependencies in the image:
```
docker run -itv $(pwd):/srv/zulip -p 9991:9991 user/zulipdev /bin/bash
$ /usr/bin/python /srv/zulip/provision.py --docker
$ /usr/bin/python /srv/zulip/tools/provision.py --docker
docker ps -af ancestor=user/zulipdev
docker commit -m "Zulip installed" <container id> user/zulipdev:v2
```

2
Vagrantfile vendored
View File

@ -71,7 +71,7 @@ $provision_script = <<SCRIPT
set -x
set -e
ln -nsf /srv/zulip ~/zulip
/usr/bin/python /srv/zulip/provision.py
/usr/bin/python /srv/zulip/tools/provision.py
SCRIPT
config.vm.provision "shell",

View File

@ -211,12 +211,13 @@ directory that would contain configuration files
(`puppet/zulip/files/postgresql`) has only a utility script and a custom
list of stopwords used by a Postgresql extension.
In a development environment, configuration of that postgresql extension
is handled by `tools/postgres-init-dev-db` (invoked by `provision.py`).
That file also manages setting up the development postgresql user.
In a development environment, configuration of that postgresql
extension is handled by `tools/postgres-init-dev-db` (invoked by
`tools/provision.py`). That file also manages setting up the
development postgresql user.
`provision.py` also invokes `tools/do-destroy-rebuild-database` to
create the actual database with its schema.
`tools/provision.py` also invokes `tools/do-destroy-rebuild-database`
to create the actual database with its schema.
### Nagios

View File

@ -84,7 +84,7 @@ CLOSURE_BINARY = '/usr/bin/closure-compiler'
if not os.path.exists(CLOSURE_BINARY):
CLOSURE_BINARY = 'tools/closure-compiler/run'
if not os.path.exists(CLOSURE_BINARY):
print("closure-compiler not installed; the Vagrant provision.py installs it via apt "\
print("closure-compiler not installed; the Vagrant tools/provision.py installs it via apt "\
"or you can manually unpack http://dl.google.com/closure-compiler/compiler-latest.zip to tools/closure-compiler")
sys.exit(1)

View File

@ -7,7 +7,9 @@ import subprocess
os.environ["PYTHONUNBUFFERED"] = "y"
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(ZULIP_PATH)
from zulip_tools import run
from scripts.lib.setup_venv import setup_virtualenv, VENV_DEPENDENCIES
@ -21,7 +23,6 @@ SUPPORTED_PLATFORMS = {
NPM_VERSION = '3.9.3'
VENV_PATH = "/srv/zulip-venv"
PY3_VENV_PATH = "/srv/zulip-py3-venv"
ZULIP_PATH = os.path.dirname(os.path.abspath(__file__))
TRAVIS_NODE_PATH = os.path.join(os.environ['HOME'], 'node')
if not os.path.exists(os.path.join(ZULIP_PATH, ".git")):

View File

@ -1,4 +1,4 @@
#!/bin/bash
set -e
set -x
python provision.py --travis
python tools/provision.py --travis

View File

@ -7,7 +7,7 @@ set -x
# to conflicts over which version of postgres should be running.
sudo apt-get remove postgresql-9.1 postgresql-client-9.1 postgresql-9.1-postgis-2.2 postgresql-contrib-9.1 postgresql-9.2 postgresql-client-9.2 postgresql-9.2-postgis-2.2 postgresql-contrib-9.2 postgresql-9.4 -y
python provision.py --travis --production-travis
python tools/provision.py --travis --production-travis
cp -a tools/travis/success-http-headers.txt ~/
source /srv/zulip-venv/bin/activate
./tools/build-release-tarball travis