Skip to content

Commit

Permalink
Updated nginx Versions (#63)
Browse files Browse the repository at this point in the history
* Updated nginx Versions

* Added nginx version 1.27
* Updated other bitnami versions
* Minor improvements to curl commands

* Repair Leia Tests

* Parse the exit code inside of the Leia test container

* Repair Leia Test

* Attempt to repair the Leia test using another method

* Updated Older Version Tests

* Updated previous version tests to reflect Leia changes
  • Loading branch information
lefte authored Oct 14, 2024
1 parent 9f03715 commit b8ebf17
Show file tree
Hide file tree
Showing 20 changed files with 95 additions and 32 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-nginx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- examples/1.24
- examples/1.25
- examples/1.26
- examples/1.27
- examples/custom

steps:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Added nginx 1.27
* Updated other versions to latest bitnami images
* Minor curl improvements

## v1.2.0 - [June 11, 2024](https://github.com/lando/nginx/releases/tag/v1.2.0)

* Added support for `nginx:1.26`.
Expand Down
11 changes: 6 additions & 5 deletions builders/nginx.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ const path = require('path');
module.exports = {
name: 'nginx',
config: {
version: '1.26',
supported: ['1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22', '1.23', '1.24', '1.25', '1.26'],
version: '1.27',
supported: ['1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22', '1.23', '1.24', '1.25', '1.26', '1.27'],
pinPairs: {
'1.26': 'bitnami/nginx:1.26.1-debian-12-r0',
'1.25': 'bitnami/nginx:1.25.3-debian-11-r1',
'1.24': 'bitnami/nginx:1.24.0-debian-11-r153',
'1.27': 'bitnami/nginx:1.27.2-debian-12-r0',
'1.26': 'bitnami/nginx:1.26.2-debian-12-r6',
'1.25': 'bitnami/nginx:1.25.5-debian-12-r7',
'1.24': 'bitnami/nginx:1.24.0-debian-12-r25',
'1.23': 'bitnami/nginx:1.23.4-debian-11-r24',
'1.22': 'bitnami/nginx:1.22.1-debian-11-r66',
'1.21': 'bitnami/nginx:1.21.6-debian-11-r21',
Expand Down
23 changes: 12 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ services:
## Supported versions
* **[1.26](https://hub.docker.com/r/bitnami/nginx)** **(default)**
* [1.25](https://hub.docker.com/r/bitnami/nginx)
* [1.24](https://hub.docker.com/r/bitnami/nginx)
* [1.23](https://hub.docker.com/r/bitnami/nginx)
* [1.22](https://hub.docker.com/r/bitnami/nginx)
* [1.21](https://hub.docker.com/r/bitnami/nginx)
* [1.20](https://hub.docker.com/r/bitnami/nginx)
* [1.19](https://hub.docker.com/r/bitnami/nginx)
* [1.18](https://hub.docker.com/r/bitnami/nginx)
* [1.17](https://hub.docker.com/r/bitnami/nginx)
* [1.16](https://hub.docker.com/r/bitnami/nginx)
* **[1.27](https://hub.docker.com/r/bitnami/nginx/tags?name=1.27)** **(default)**
* [1.26](https://hub.docker.com/r/bitnami/nginx/tags?name=1.26)
* [1.25](https://hub.docker.com/r/bitnami/nginx/tags?name=1.25)
* [1.24](https://hub.docker.com/r/bitnami/nginx/tags?name=1.24)
* [1.23](https://hub.docker.com/r/bitnami/nginx/tags?name=1.23)
* [1.22](https://hub.docker.com/r/bitnami/nginx/tags?name=1.22)
* [1.21](https://hub.docker.com/r/bitnami/nginx/tags?name=1.21)
* [1.20](https://hub.docker.com/r/bitnami/nginx/tags?name=1.20)
* [1.19](https://hub.docker.com/r/bitnami/nginx/tags?name=1.19)
* [1.18](https://hub.docker.com/r/bitnami/nginx/tags?name=1.18)
* [1.17](https://hub.docker.com/r/bitnami/nginx/tags?name=1.17)
* [1.16](https://hub.docker.com/r/bitnami/nginx/tags?name=1.16)
* [custom](https://docs.lando.dev/core/v3/services/lando.html#overrides)
## Patch versions
Expand Down
2 changes: 1 addition & 1 deletion examples/1.16/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ lando ssh -s patch -c "nginx -v 2>&1 | grep 1.16.1"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.17/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ lando ssh -s patch -c "nginx -v 2>&1 | grep 1.17.10"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.18/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.18"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.19/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.19"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.20/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.20"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.21/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.21"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.22/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.22"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.23/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.23"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.24/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.24"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.25/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.25"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
2 changes: 1 addition & 1 deletion examples/1.26/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.26"
lando ssh -s defaults -c "curl http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 1
lando ssh -s defaults -c "curl https://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down
11 changes: 11 additions & 0 deletions examples/1.27/.lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: lando-nginx-127
services:
defaults:
type: nginx:1.27
build_as_root:
- apt-get update && apt-get install -y curl

# This is important because it lets lando know to test against the plugin in this repo
# DO NOT REMOVE THIS!
plugins:
"@lando/nginx": ../..
44 changes: 44 additions & 0 deletions examples/1.27/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
nginx Example
=============

This example exists primarily to test the following documentation:

* [nginx Service](https://docs.devwithlando.io/tutorials/nginx.html)

Start up tests
--------------

Run the following commands to get up and running with this example.

```bash
# Should start up successfully
lando poweroff
lando start
```

Verification commands
---------------------

Run the following commands to validate things are rolling as they should.

```bash
# Should use 1.27.x as the default version
lando ssh -s defaults -c "nginx -v 2>&1 | grep 1.27"

# Should serve from the app root by default
lando ssh -s defaults -c "curl -s http://localhost | grep ROOTDIR"

# Should only serve over http by default
lando ssh -s defaults -c "curl -s --write-out \"%{exitcode}\" https://localhost | grep 7"
```

Destroy tests
-------------

Run the following commands to trash this app like nothing ever happened.

```bash
# Should be destroyed with success
lando destroy -y
lando poweroff
```
1 change: 1 addition & 0 deletions examples/1.27/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ROOTDIR
2 changes: 1 addition & 1 deletion examples/custom/.lando.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: lando-nginx-custom
services:
custom:
type: nginx:1.25
type: nginx:1.27
ssl: true
webroot: www
build_as_root:
Expand Down
8 changes: 4 additions & 4 deletions examples/custom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ Run the following commands to validate things are rolling as they should.

```bash
# Should serve from webroot if specified
lando ssh -s custom -c "curl http://localhost" | grep WWWDIR
lando ssh -s custom_116 -c "curl http://localhost | grep WWWDIR"
lando ssh -s custom -c "curl -s http://localhost" | grep WWWDIR
lando ssh -s custom_116 -c "curl -s http://localhost | grep WWWDIR"

# Should serve from https when specified
lando ssh -s custom -c "curl https://localhost | grep WWWDIR"
lando ssh -s custom_116 -c "curl https://localhost | grep WWWDIR"
lando ssh -s custom -c "curl -s https://localhost | grep WWWDIR"
lando ssh -s custom_116 -c "curl -s https://localhost | grep WWWDIR"

# Should mount custom config to the correct locations and render the correct vars
lando ssh -s custom -c "cat /opt/bitnami/nginx/conf/nginx.conf" | grep LANDOSERVER
Expand Down

0 comments on commit b8ebf17

Please sign in to comment.