You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Debugging a packaging test failure](#debugging-a-packaging-test-failure)
29
29
*[Tutorial: building your own packages](#tutorial-building-your-own-packages)
30
30
*[Related projects](#related-projects)
@@ -49,20 +49,14 @@ Debian package definitions are located in the `debian_specs` directory:
49
49
Other noteworthy tools:
50
50
51
51
*`shell` -- Open a shell in a new buildbox container for debugging purposes.
52
-
*`jenkins/` -- Scripts to be run by our Jenkins continuous integration jobs, either after every commit or during release time.
52
+
*`jenkins/` -- Scripts to be run by our continuous integration jobs, either after every commit or during release time.
53
53
54
-
This project utilizes Docker for isolation. Because of the usage of Docker, these tools can be run on any 64-bit Linux system, including non-Debian-based systems. Though in practice, we've only tested on Ubuntu.
54
+
This project utilizes Docker for isolation. Because of the usage of Docker, these tools can be run on any 64-bit Linux system, though you do need the debian distro-info package installed.
55
55
56
56
## Development
57
57
58
58
This repository is included as a git submodule in the Passenger git repository, under the directory `packaging/debian`. Instead of cloning the `passenger_apt_automation` repository directly, you should clone the Passenger git repository, and work in the `packaging/debian` directory instead. This scheme allows each Passenger version to lock down to a specific version of `passenger_apt_automation`.
59
59
60
-
A Vagrantfile is provided so that you can develop this project in a VM. To get started, run:
61
-
62
-
host$ vagrant up
63
-
64
-
The Passenger source directory (`../..`) will be automatically mounted inside the VM under `/passenger`.
65
-
66
60
## Package building process
67
61
68
62
The package build process is as follows. First, the `build` script is used to build Debian packages from a Passenger source code directory. Next, either the `test` script is run to test the built packages, or the `publish` script is run to publish the built packages to repos.phusionpassenger.com.
@@ -103,10 +97,6 @@ When the build script is finished, the output directory (`-o`) will contain one
103
97
|
104
98
...
105
99
106
-
#### Vagrant notes
107
-
108
-
When using Vagrant, the directories referred to by `-w` and `-c` must be native filesystem directories. That is, they may not be located inside /vagrant, because /vagrant is a remote filesystem. I typically use `-w ~/work -c ~/cache` when developing with Vagrant.
109
-
110
100
#### Troubleshooting
111
101
112
102
If anything goes wrong during a build, please take a look at the various log files in the work directory. Of interest are:
@@ -125,12 +115,6 @@ Once packages have been built, you can test them with the test script. Here is a
125
115
*`-d` tells it where to find the packages that are to be tested. This must point to a subdirectory in the output directory produced by the build script, and the packages must match the test environment as specified by `-x`. For example, if you specified `-x noble`, and if the build script stored packages in the directory `output`, then you should pass `-d output/noble`.
126
116
*`-c` tells it where the cache directory is. The test script caches files into this directory so that subsequent runs will be faster.
127
117
128
-
#### Vagrant notes
129
-
130
-
When using Vagrant, the directory referred to by `-c` must be a native filesystem directory. That is, it may not be located inside /vagrant, because /vagrant is a remote filesystem. I typically use `-c ~/cache` when developing with Vagrant.
131
-
132
-
The Vagrant VM uses 2 GB of RAM, so make sure your host has at least 4 GB.
133
-
134
118
### The publish script
135
119
136
120
Once packages have been built, you can publish them to repos.phusionpassenger.com. The `publish` script publishes all packages inside a build script output directory. Example invocation:
@@ -160,9 +144,8 @@ In these instructions, we assume that the new distribution is Ubuntu 20.04 "Foca
160
144
161
145
2. Add a definition for this new distribution to `internal/lib/distro_info.rb`.
162
146
163
-
1. Add to either the `UBUNTU_DISTRIBUTIONS` or the `DEBIAN_DISTRIBUTIONS` constant.
164
-
2. Add to the `DEFAULT_DISTROS` constant.
165
-
3. If it's a debian release you'll likely have to add the signing key to the buildbox's install.sh. (If debootstrap complains about a key in step 6).
147
+
1. Add to the `DEFAULT_DISTROS` constant.
148
+
2. If it's a debian release you'll likely have to add the signing key to the buildbox's install.sh. (If debootstrap complains about a key in step 6).
166
149
167
150
3. Run `internal/scripts/regen_distro_info_script.sh`.
168
151
@@ -171,10 +154,10 @@ In these instructions, we assume that the new distribution is Ubuntu 20.04 "Foca
171
154
make -C docker-images buildbox
172
155
173
156
5. Update the package definitions in `debian_specs/`.
174
-
157
+
175
158
1. Check if new ruby is available in distro update versions or comments in `debian_specs/passenger/helpers.rb`
176
159
2. Add `<% if %>` statements accordingly to output the appropriate content for the target distribution. (e.g. in `debian_specs/passenger/control.erb`)
177
-
160
+
178
161
6. Build publish packages for this distribution only. You can do that by running the build script with the `-d` option.
179
162
180
163
For example:
@@ -186,7 +169,7 @@ In these instructions, we assume that the new distribution is Ubuntu 20.04 "Foca
186
169
1. Create `docker-images/testbox-ubuntu-20.04/` (copy of testbox of previous release)
187
170
2. Set the correct From in `docker-images/testbox-ubuntu-20.04/Dockerfile`
188
171
3. Edit `docker-images/Makefile` and add entries for this new testbox.
189
-
172
+
190
173
make -C docker-images testbox-ubuntu-20.04
191
174
192
175
When done, test Passenger under the new testbox:
@@ -210,9 +193,7 @@ In these instructions, we assume that the new distribution is Ubuntu 20.04 "Foca
210
193
git pull
211
194
cd ../..
212
195
213
-
2. Update `dev/ci/tests/debian/Jenkinsfile` and add this new distro under the `parameters` section.
214
-
215
-
3. Commit and push the result:
196
+
2. Commit and push the result:
216
197
217
198
git commit -a -m "Add packaging support for Ubuntu 20.04 Focal"
218
199
git push
@@ -244,9 +225,7 @@ In these instructions, we assume that the distribution to be removed is Ubuntu 2
244
225
git pull
245
226
cd ../..
246
227
247
-
2. Update `dev/ci/tests/debian/Jenkinsfile` and remove the deprecated distro under the `params` section.
248
-
249
-
3. Commit and push the result:
228
+
2. Commit and push the result:
250
229
251
230
git commit -a -m "Remove packaging support for Ubuntu 20.04 Focal"
252
231
git push
@@ -265,10 +244,6 @@ The first way is by deleting the pbuilder chroot tarball in the cache directory.
The second way is by updating it in-place. For example:
273
248
274
249
1. Run: `./shell -c ~/cache`. This will drop you into the buildbox shell.
@@ -278,13 +253,13 @@ The second way is by updating it in-place. For example:
278
253
279
254
### Updating SSL certificates
280
255
281
-
The Jenkins publishing script posts to some HTTPS servers. For security reasons, we pin the certificates, but these certificates expire after a while. You can update them by running:
256
+
The publishing script posts to some HTTPS servers. For security reasons, we pin the certificates, but these certificates expire after a while. You can update them by running:
282
257
283
258
./internal/scripts/pin_certificates
284
259
285
-
## Jenkins integration
260
+
## CI integration
286
261
287
-
The `jenkins` directory contains scripts which are invoked from jobs in the Phusion Jenkins CI server.
262
+
The `jenkins` directory contains scripts which are invoked from jobs in the Phusion CI server.
288
263
289
264
## Troubleshooting
290
265
@@ -298,17 +273,12 @@ If a packaging test job fails, here's what you should do.
298
273
git reset --hard <COMMIT FOR WHICH THE TEST FAILED>
299
274
cd packaging/debian
300
275
301
-
2. If you're not on Linux, setup the Vagrant development environment and login to the VM:
302
-
303
-
vagrant up
304
-
vagrant ssh
305
-
306
-
3. Build packages for the distribution for which the test failed.
276
+
2. Build packages for the distribution for which the test failed.
@@ -327,8 +297,8 @@ Packages are built to `output/<distro>`. You can play around manually with exami
327
297
dpkg -I passenger_5.1.x-1~distro1_amd64.deb # view info
328
298
dpkg -i passenger_5.1.x-1~distro1_amd64.deb # install passenger (probably need to install a module too)
329
299
apt --fix-broken install # to install dependencies
330
-
331
-
300
+
301
+
332
302
333
303
## Tutorial: building your own packages
334
304
@@ -340,9 +310,7 @@ You can follow this tutorial on any OS you want. You do not necessarily have to
340
310
341
311
If you are following this tutorial on a Linux system, then you must [install Docker](https://www.docker.com/).
342
312
343
-
If you are following this tutorial on any other OS, then you must install [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/).
344
-
345
-
NOTE: If you are on macOS, installing Docker for Mac is NOT enough. You MUST use Vagrant+VirtualBox.
313
+
NOTE: If you are on macOS, installing Docker for Mac is NOT enough. You MUST use a virtual machine with docker installed there.
346
314
347
315
### Step 1: Checkout out the desired source code
348
316
@@ -360,21 +328,7 @@ Then go to the directory `packaging/debian`:
360
328
361
329
cd packaging/debian
362
330
363
-
### Step 2 (non-Linux only): spin up Vagrant VM
364
-
365
-
If you are on a Linux system, then you can skip to step 3.
366
-
367
-
If you are not on a Linux system, then you must spin up the Vagrant VM. Type:
368
-
369
-
vagrant up
370
-
371
-
Wait until the VM has booted, then run:
372
-
373
-
vagrant ssh
374
-
375
-
You will now be dropped in an SSH session inside the VM. Any futher steps must be followed inside this SSH session.
376
-
377
-
### Step 3: build packages
331
+
### Step 2: build packages
378
332
379
333
Use the `./build` script to build packages. You must tell the build script which distribution and architecture it should build for. Run:
380
334
@@ -383,7 +337,6 @@ Use the `./build` script to build packages. You must tell the build script which
383
337
Replace `<PATH TO PASSENGER>` with one of these:
384
338
385
339
* If you are on a Linux system, it should be `../..`.
386
-
* If you are on a non-Linux system (and using Vagrant), it should be `/passenger`.
387
340
388
341
Replace `<ARCHITECTURE>` with either `arm64` or `amd64`. Replace `<DISTRIBUTION>` with the codename of the distribution you want to build for. For example:
389
342
@@ -398,23 +351,13 @@ You can find the codename of your distribution version on Wikipedia: [Ubuntu cod
398
351
Here is an example invocation for building packages for Ubuntu 24.04, x86_64:
When the build is finished, you can find the packages in the `output` directory.
411
360
412
-
If you are on a non-Linux OS (and thus using Vagrant), you should know that this `output` directory is accessible from your host OS too. It is a subdirectory inside `<PASSENGER REPO>/packaging/debian`.
413
-
414
-
If you are not on a Linux system, then you should spin down the Vagrant VM. Run this on your host OS, inside the `packaging/debian` subdirectory:
0 commit comments