forked from weewx/weewx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DEV_NOTES.txt
291 lines (217 loc) · 8.5 KB
/
DEV_NOTES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
checklist for doing a release:
1. Check weewx.conf for local changes. In particular, check to make sure:
1. WEEWX_ROOT points to /home/weewx
2. debug=0 in weewx.conf
2. Make sure the correct version has been entered:
1. weewx.__init__.py
2. weewx.conf
3. docs/*.htm
3. Make sure all changes have been logged
1. docs/changes.txt
2. pkg/debian/changelog
3. pkg/changelog.rpm
4. Make sure the upgrading guide has been updated if necessary.
5. If working off a branch, do a merge to master.
6. Create the tarball: ./setup.py sdist
7. Sanity check on production machine: unpack the tarball, install, run.
8. Tag it: git tag -a v1.3.1 -m "Version 1.3.1 release"
9. Upload to weewx.com:
1. make upload-src
2. make upload-deb
3. make upload-rpm RPMOS=.rhel
4. make upload-rpm RPMOS=.suse
5. make upload-readme
6. make upload-docs
10. Update the deb repository
11. Run a backup on condor
12. Announce the release to the weewx user's group.
release process by command: ---------------------------------------------------
# on any host, do a fresh checkout, set the version and update changelogs
git clone https://github.com/weewx/weewx.git
vi bin/weewx/__init__.py
make version
make deb-changelog
make rpm-changelog
vi docs/changes.txt # as needed
vi docs/upgrading.htm # as needed
git commit -a -m "release x.y.z"
git push
# generate the readme then upload it to development_versions
make readme upload-readme
# build src, upload to development_versions
rm -rf build dist
make src-package upload-src
# on debian host, build deb package, upload to development_versions
rm -rf build dist
make deb-package upload-deb
# on redhat host, build the redhat rpm package, upload to development_versions
rm -rf build dist
make rpm-package upload-rpm
# on suse host, build the suse rpm package, upload to development_versions
rm -rf build dist
make rpm-package upload-rpm
# tag the release
git tag -a vX.Y.Z -m "tag release X.Y.Z"
# upload the docs
git clone https://github.com/weewx/website.git
make upload-docs
# move the new files into position
make release
# update the apt repository (requires aptly and local clone of the apt repo)
make update-apt-repo
make push-apt-repo
howto -------------------------------------------------------------------------
create README.txt:
make readme
how to update the version number:
perl -pi -e 's/__version__=".*"/__version__="x.y.z"/' bin/weewx/__init__.py
make version # this propagates the version number everywhere
git commit -a -m "bump to version x.y.z"
how to build source package:
make src-package
how to build debian package:
make deb-changelog
emacs pkg/debian/changelog # add any package-specific changes, if any
git commit -m "update deb changelog" pkg/debian/changelog
make deb-package
how to build redhat package:
make rpm-changelog
emacs pkg/changelog.rpm # add any package-specific changes, if any
git commit -m "update rpm changelog" pkg/changelog.rpm
make rpm-package
to display debconf variables:
sudo debconf-show weewx
to manually purge debconf variables:
echo PURGE | sudo debconf-communicate weewx
to sign rpm packages you need .rpmmacros in your home directory:
~/.rpmmacros
%_signature gpg
%_gpg_name Matthew Wall
to generate gpg key used for signing packages:
gpg --gen-key
gpg --list-keys
to export the text version of a public key:
gpg --export -a "Matthew Wall" > mwall.gpg.key
source install:
setup.py install
setup.py install home=/opt/weewx-x.y.z
debian install/remove:
dpkg -i weewx_x.y.z-r.deb # install
(apt-get install weewx) # finish install if dependencies failed
dpkg -r weewx # remove
dpkg -P weewx # purge
redhat install/remove:
yum install weewx-x.y.z-r.rpm [--nogpgcheck] # install with yum
yum remove weewx # remove with yum
rpm -i weewx-x.y.z-r.rpm # install with rpm directly
rpm -e weewx # remove with rpm
create debian repo using aptly:
aptly repo create -distribution=squeeze -component=main weewx
aptly repo add weewx dist/weewx_3.0.0-1_all.deb
aptly snapshot create weewx-3.0.0 from repo weewx
aptly -architectures="all" publish snapshot weewx-3.0.0
update debian repo using aptly:
aptly repo add weewx dist/weewx_3.0.1-1_all.deb
aptly snapshot create weewx-3.0.1 from repo weewx
aptly -architectures="all" publish switch squeeze weewx-3.0.1
clone the published apt repo at godaddy to local space:
mkdir -p ~/.aptly
rsync -arv --rsync-path /home/content/t/o/m/tomkeffer/bin/rsync -e ssh USER@weewx.com:/home/content/t/o/m/tomkeffer/html/aptly/ ~/.aptly
synchronize local aptly changes with the published apt repo at godaddy:
rsync -arv --rsync-path /home/content/t/o/m/tomkeffer/bin/rsync -e ssh ~/.aptly/ USER@weewx.com:/home/content/t/o/m/tomkeffer/html/aptly
for clients to use an apt repo at weewx.com:
curl -s http://weewx.com/keys.html | sudo apt-key add -
echo "deb [arch=all] http://weewx.com/apt/ squeeze main" | sudo tee /etc/apt/sources.list.d/weewx.list
notes -------------------------------------------------------------------------
there are multiple changelogs:
docs/changes.txt - definitive changelog for the application
pkg/debian/changelog - changes to the debian packaging
pkg/changelog.rpm - changes to the redhat packaging
README.txt - copy of changes.txt uploaded to download area
when signing, gpg info must match the name and email in the latest package
changelog entry.
the debian changelog *must* have a version number that matches the app version.
the redhat package will build if the version numbers do not match. use the
rpm-changelog and deb-changelog targets to ensure that changelog versions match
the application version for a release.
there are many ways to build a debian package. first tried dpkg (uses DEBIAN
dir and is fairly low-level) but that does not create changes and source diffs.
then dried dpkg-buildpackage (uses debian dir and is higher level) but misses
the config and templates. ended up using dpkg-buildpackage with some manual
(scripted) file manipulation.
to do debian builds you must first install:
python-imaging
python-configobj
debhelper
to do repo updates you must first install aptly:
https://www.aptly.info/download/
for example, on debian:
echo "deb http://repo.aptly.info/ squeeze main" | sudo tee /etc/apt/sources.list.d/aptly.list
wget -qO - https://www.aptly.info/pubkey.txt | sudo apt-key add -
sudo apt-get update
sudo apt-get install aptly
unit tests --------------------------------------------------------------------
prerequisites:
python 2.7
python-usb
python-mock 0.6
pyephem
to set up mysql server with user and permissions for testing:
make test-setup
to run all unit tests:
make test
to clean up after running tests:
make test-clean
guidelines:
unit tests should put transient files in /var/tmp/weewx_test
testing -----------------------------------------------------------------------
what to test when creating debian and redhat packages:
install, upgrade, remove, purge
install, modify files, remove
install, modify files, upgrade
any linux:
- new install using setup.py to /home/weewx
setup.py install
- upgrade using setup.py to /home/weewx
setup.py install
modify /home/weewx/weewx.conf
setup.py install
- new install using setup.py to /opt/weewx
setup.py install home=/opt/weewx
- upgrade using setup.py to /opt/weewx
setup.py install home=/opt/weewx
modify /opt/weewx/weewx.conf
setup.py install home=/opt/weewx
on centos and suse:
- new install using rpm
rpm -i weewx_x.y.z.rpm
- upgrade using rpm
rpm -i weewx_r.s.t.rpm
rpm -U weewx_x.y.z.rpm
- upgrade using rpm with extensions installed
rpm -i weewx_r.s.t.rpm
wee_extension --install cmon
rpm -U weewx_x.y.z.rpm
debian:
- new install usinb dpkg
dpkg -i weewx_x.y.z.deb
- upgrade using dpkg take maintainer's version of weewx.conf
dpkg -i weewx_r.s.t.deb
modify /etc/weewx/weewx.conf
dpkg -i weewx_x.y.z.deb
- upgrade using dpkg use old version of weewx.conf
dpkg -i weewx_r.s.t.deb
modify /etc/weewx/weewx.conf
dpkg -i weewx_x.y.z.deb
- reconfigure using dpkg
dpkg-reconfigure weewx
all platforms:
- installation and removal of extensions
wee_extension --install cmon
wee_extension --install pmon
wee_extension --remove cmon
- reconfigure using wee_config
wee_config --reconfigure
wee_config --reconfigure --driver=weewx.drivers.vantage
- list drivers
wee_config --list-drivers