]> scripts.mit.edu Git - wizard.git/blob - doc/setup.rst
Permute the ordering of test script names in docs.
[wizard.git] / doc / setup.rst
1 Setting up Wizard
2 =================
3
4 :Author: Edward Z. Yang <ezyang@mit.edu>
5
6 .. highlight:: sh
7
8 Probably the easiest way to do development is entirely on :term:`AFS`, so that if you
9 SSH into a scripts server to perform testing, you will be able
10 to invoke your tools and read your development repository.  In order
11 to be able to run the test scripts in the tests directory, this
12 is preferably in :file:`web_scripts`.  First, you should ensure that you
13 are signed up web scripts service and sql.mit.edu::
14
15     athrun scripts # Select "Enable the web scripts service" and "Sign up for a sql.mit.edu account"
16
17 .. note::
18
19     If you are running on a operating system that does not have support
20     for AFS and other standard Debathena tools, it is highly recommended
21     that you SSH into a server that does, such as `Linerva <http://linerva.mit.edu/>`_
22     to perform development.  We will now assume all commands are
23     being done on a server similar to Linerva.
24
25 In that case, setup is as simple as::
26
27     git clone /mit/scripts/git/wizard.git /mit/$USER/web_scripts/wizard
28
29 Other users will not be able to access your source code, which may be
30 detrimental if you want to let other people test your code.  If you change the
31 access control to allow ``system:anyuser`` to read your source code (in case
32 you want to let other people test your code), do *not* give access to the
33 :file:`tests` directory, which may contain sensitive data once you start
34 running tests.  A set of commands that will let you do this would be::
35
36     athrun consult fsr sa /mit/$USER/web_scripts/wizard system:anyuser read
37     athrun consult fsr sa /mit/$USER/web_scripts/wizard/tests system:anyuser none
38
39 Finally, you need to generate some metadata for Python.  You can do this
40 by running::
41
42     ./refresh.sh
43
44 in the root of your Wizard installation.
45
46 To test if your setup is now working, run one of the test scripts on a Scripts
47 server::
48
49     ssh scripts.mit.edu
50     /mit/$USER/web_scripts/wizard/tests/mediawiki-install-test.sh
51
52 Application development
53 -----------------------
54
55 By default, Wizard will go and look for Git repositories for our various
56 applications in the :file:`/mit/scripts/git/autoinstalls` directory.
57 However, if you're developing your own application, you'll probably have
58 your own directory (probably living in :file:`/mit/$USER/web_scripts/wizard/srv`)
59 and you want Wizard to use those files.  In that case, you can override
60 the directory Wizard is looking at with::
61
62     export WIZARD_SRV_PATH=/mit/$USER/web_scripts/wizard/srv
63
64 You may call this command a lot, so placing it in a small shell file (e.g. :file:`dev`) that
65 you include with::
66
67     . dev
68
69 at your prompt may be useful.  This also means that Wizard will think you
70 have *no* applications initially; you'll have to clone (or symlink)
71 the appropriate repositories manually::
72
73     git clone /mit/scripts/git/autoinstalls/$APP.git /mit/$USER/web_scripts/wizard/srv/$APP
74
75 Advanced setup
76 --------------
77
78 These instructions are for if you'd like to be able to develop offline and are
79 on ``scripts-root``.  Wizard will mostly work on your local machine, but you
80 won't be able to do all development offline; some steps in the development
81 process must be performed on scripts servers.  Thus, the difficult part is
82 marshalling commits from one repository to another. Git doesn't exactly make
83 this easy, but you can follow this recipe::
84
85     git clone ssh://scripts@scripts.mit.edu/mit/scripts/git/wizard.git ~/wizard
86     cd /mit/$USER
87     mkdir wizard.git
88     cd wizard.git
89     git init --bare
90     cd ~/wizard
91     git remote add afs /mit/$USER/wizard.git
92     git push -f afs master
93     git clone /mit/$USER/wizard.git /mit/$USER/wizard
94
95 We create a bare repository :file:`/mit/$USER/wizard.git` that you can push and
96 pull from, and then setup an alternate remote ``afs`` on your offline copy.
97
98 And then you can perform updates from your local copy with::
99
100     git push afs master
101     cd /mit/$USER/wizard
102     git pull
103
104 If :file:`/mit/$USER/wizard.git` has write permissions for
105 ``system:scripts-security-upd``, this is especially useful if you were hacking
106 on a copy living on ``not-backward.mit.edu``, and now need to transfer the
107 changes back to the canonical repository (please don't give ``not-backward.mit.edu``
108 your root tickets!)  You can also setup a wizard directory similar to the
109 first set of directions for on-server testing.
110
111 Setting up the tests scripts to work is also slightly involved; more
112 instructions can be found on the :doc:`testing documentation <testing>`.
113
114 .. warning::
115
116     These instructions are not well tested.  Let me know if you run into
117     any difficulties.
118