Browse Source

Add documentation for packetary

Closes-bug: #1604989
Closes-bug: #1604996

Change-Id: Ib214006c4852af9b08702368d55f157f7bba089a
Ivan Bogomazov 2 years ago
parent
commit
c46465c325
2 changed files with 159 additions and 7 deletions
  1. 36
    5
      doc/source/installation.rst
  2. 123
    2
      doc/source/usage.rst

+ 36
- 5
doc/source/installation.rst View File

@@ -2,11 +2,42 @@
2 2
 Installation
3 3
 ============
4 4
 
5
-At the command line::
5
+Install system requirements - DEB based OS::
6 6
 
7
-    $ pip install packetary
7
+    ~ $ sudo aptitude install yum \
8
+        yum-utils \
9
+        createrepo \
10
+        mock \
11
+        sbuild \
12
+        git \
13
+        libxml2-dev \
14
+        libxslt1-dev \
15
+        python-dev \
16
+        python-virtualenv \
17
+        zlib1g-dev
8 18
 
9
-Or, if you have virtualenvwrapper installed::
19
+Install system requirements - RPM based OS::
10 20
 
11
-    $ mkvirtualenv packetary
12
-    $ pip install packetary
21
+    ~ $ sudo aptitude install yum \
22
+        yum-utils \
23
+        createrepo \
24
+        mock \
25
+        sbuild \
26
+        git \
27
+        libxml2-devel \
28
+        libxslt1-devel \
29
+        python-devel \
30
+        python-virtualenv \
31
+        zlib-devel
32
+
33
+Install from sources::
34
+
35
+    ~ $ git clone https://git.openstack.org/openstack/packetary
36
+    ~ $ cd packetary/
37
+    ~/packetary$ virtualenv .venv
38
+    ~/packetary$ source .venv/bin/activate
39
+    ~/packetary$ pip install -r requirements.txt
40
+    ~/packetary$ python setup.py install
41
+
42
+Install from package::
43
+    ~ $ pip install packetary

+ 123
- 2
doc/source/usage.rst View File

@@ -2,6 +2,127 @@
2 2
 Usage
3 3
 ========
4 4
 
5
-To use packetary in a project::
5
+Build packages with packetary
6
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 7
 
7
-    import packetary
8
+Build packages::
9
+
10
+    ~/packetary$ packetary build --type rpm \
11
+                 --input-data packages.yaml \
12
+                 --output-dir /tmp/rpm/packages
13
+
14
+Format of repos.yaml and packages.yaml provided below.
15
+
16
+packages.yaml::
17
+
18
+    - source: /home/arno/projects/mirantis/mock-sandbox/zeromq
19
+      spec: /home/arno/projects/mirantis/mock-sandbox/zeromq/zeromq.spec
20
+      release: centos-5-x86_64
21
+
22
+    - source: /home/arno/projects/mirantis/mock-sandbox/zeromq
23
+      spec: /home/arno/projects/mirantis/mock-sandbox/zeromq/zeromq.spec
24
+      release: centos-7-x86_64
25
+
26
+
27
+Clone custom repositories
28
+^^^^^^^^^^^^^^^^^^^^^^^^^
29
+
30
+Cloning rpm repos::
31
+
32
+    packetary clone -t rpm \
33
+                    -r centos_mirror.yaml \
34
+                    -R centos_packages.yaml \
35
+                    -d /tmp/mirror
36
+
37
+Clone deb repos::
38
+
39
+    packetary clone -t deb \
40
+                    -r ubuntu_mirrors.yaml \
41
+                    -R ubuntu_packages.yaml \
42
+                    -d /tmp/mirror
43
+
44
+where:
45
+
46
+-t - rpm or deb. In our case we work with rpm repos
47
+
48
+-r - mirror(s) list to work with
49
+
50
+-R - additional filter that should be applied to repo,
51
+     eg.: clone exact packages, exclude some packages by name
52
+     (for example, debuginfo)
53
+
54
+YAML examples below
55
+
56
+centos_mirror.yaml::
57
+
58
+     - name: "mos-repos"
59
+       uri: "http://mirror.seed-cz1.fuel-infra.org/mos-repos/centos/mos-master-centos7/os/x86_64/"
60
+       priority: 1
61
+       path: "/tmp/mirror/mos-centos"
62
+
63
+     - name: "upstream-os"
64
+       uri: http://mirror.centos.org/centos/7/os/x86_64
65
+       priority: 90
66
+       path: "/tmp/mirror/centos"
67
+
68
+     - name: "upstream-updates"
69
+       uri: "http://mirror.centos.org/centos/7/updates/x86_64"
70
+       priority: 10
71
+       path: "/tmp/mirror/centos"
72
+
73
+     - name: "upstream-extras"
74
+       uri: "http://mirror.centos.org/centos/7/extras/x86_64"
75
+       priority: 90
76
+       path: "/tmp/mirror/centos"
77
+
78
+centos_packages.yaml::
79
+
80
+    repositories:
81
+        - name: mos-repos
82
+          excludes:
83
+              - name: "/^.*debuginfo.*/"
84
+
85
+    packages:
86
+        - name: Cython
87
+        - name: GeoIP
88
+        - name: MySQL-python
89
+        - name: NetworkManager
90
+        - name: NetworkManager-team
91
+        - name: NetworkManager-tui
92
+        - name: PyPAM
93
+        # fuel packages
94
+        - name: fencing-agent
95
+        - name: fuel
96
+        - name: fuel-agent
97
+        - name: fuel-bootstrap-cli
98
+        - name: fuel-ha-utils
99
+        - name: fuel-library
100
+        - name: fuelmenu
101
+        - name: fuel-migrate
102
+
103
+ubuntu_packages.yaml::
104
+
105
+    mandatory: exact
106
+
107
+    # we don't need debug packages
108
+    repositories:
109
+        - name: "ubuntu"
110
+          excludes:
111
+              - group: "debug"
112
+
113
+    packages:
114
+        - name: aodh-api
115
+        - name: aodh-common
116
+        - name: aodh-doc
117
+        - name: aodh-evaluator
118
+        - name: aodh-expirer
119
+        - name: aodh-listener
120
+
121
+ubuntu_mirrors.yaml::
122
+
123
+    - name: "mos9.0-ubuntu"
124
+      uri: "http://mirror.seed-cz1.fuel-infra.org/mos-repos/ubuntu/9.0/"
125
+      suite: "mos9.0"
126
+      section: ["main", "restricted"]
127
+      priority: 1000
128
+       path: "/tmp/mirrors/ubuntu"

Loading…
Cancel
Save