Salome HOME
add doc/build for EZ direct html or pdf
[tools/sat.git] / doc / build / html / _sources / commands / prepare.txt
1
2 .. include:: ../../rst_prolog.rst
3
4 Command prepare
5 ****************
6
7 Description
8 ===========
9 The **prepare** command brings the sources of an application in the *sources 
10 application directory*, in order to compile them with the compile command.
11
12 The sources can be prepared from VCS software (*cvs, svn, git*), an archive or a directory.
13
14 .. warning:: When sat prepares a product, it first removes the 
15              existing directory, except if the development mode is activated.
16              When you are working on a product, you need to declare in 
17              the application configuration this product in **dev** mode.
18
19 Remarks
20 =======
21
22 VCS bases (git, svn, cvs)
23 -------------------------
24
25 The *prepare* command does not manage authentication on the cvs server.
26 For example, to prepare modules from a cvs server, you first need to login once.
27
28 To avoid typing a password for each product, 
29 you may use a ssh key with passphrase, or store your password 
30 (in .cvspass or .gitconfig files).
31 If you have security concerns, it is also possible to use 
32 a bash agent and type your password only once.
33
34
35
36 Dev mode
37 --------
38
39 By default *prepare* uses *export* mode: it creates an image 
40 of the sources, corresponding to the tag or branch specified, 
41 without any link to the VCS base. 
42 To perform a *checkout* (svn, cvs) or a *git clone* (git), 
43 you need to declare the product in dev mode in your application configuration:
44 edit the application configuration file (pyconf) and modify the product declaration:
45
46 .. code-block:: bash
47
48     sat config <application> -e
49     # and edit the product section:
50     #   <product> : {tag : "my_tag", dev : "yes", debug : "yes"}
51
52 The first time you will execute the *sat prepare* command, 
53 your module will be downloaded in *checkout* mode 
54 (inside the SOURCES directory of the application.
55 Then, you can develop in this repository, and finally push 
56 them in the base when they are ready.
57 If you type during the development process by mistake 
58 a *sat prepare* command, the sources in dev mode will 
59 not be altered/removed (Unless you use -f option)
60
61
62 Usage
63 =====
64 * Prepare the sources of a complete application in SOURCES directory (all products): ::
65
66     sat prepare <application>
67
68 * Prepare only some modules: ::
69
70     sat prepare <application>  --products <product1>,<product2> ...
71
72 * Use --force to force to prepare the products in development mode 
73   (this will remove the sources and do a new clone/checkout): ::
74
75     sat prepare <application> --force
76
77 * Use --force_patch to force to apply patch to the products 
78   in development mode (otherwise they are not applied): ::
79
80     sat prepare <application> --force_patch
81
82
83 Some useful configuration pathes
84 =================================
85
86 Command *sat prepare* uses the *pyconf file configuration* of each product to know how to get the sources.
87
88 .. note:: to verify configuration of a product, and get name of this *pyconf files configuration*
89
90   .. code-block :: bash
91
92      sat config <application> --info <product>
93
94
95 * **get_method**: the method to use to prepare the module, possible values are cvs, git, archive, dir.
96 * **git_info** : (used if get_method = git) information to prepare sources from git.
97 * **svn_info** : (used if get_method = svn) information to prepare sources from cvs.
98 * **cvs_info** : (used if get_method = cvs) information to prepare sources from cvs.
99 * **archive_info** : (used if get_method = archive) the path to the archive.
100 * **dir_info** : (used if get_method = dir) the directory with the sources.