forked from paketo-buildpacks/php-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement buildpack Signed-off-by: Rob Dimsdale-Zucker <[email protected]> * add an offline test * Update README.md Co-authored-by: Tim Hitchener <[email protected]> * Update README.md Co-authored-by: Tim Hitchener <[email protected]> * modify provision name to include php * manually update github config * Update README.md Co-authored-by: Rob Dimsdale-Zucker <[email protected]> Co-authored-by: Tim Hitchener <[email protected]>
- Loading branch information
1 parent
d2ebbd0
commit 1c290e5
Showing
38 changed files
with
3,054 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
name: Auto-label PR | ||
name: Set / Validate PR Labels | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- synchronize | ||
- opened | ||
- reopened | ||
- labeled | ||
- unlabeled | ||
|
||
concurrency: pr_labels | ||
concurrency: pr_labels_${{ github.event.number }} | ||
|
||
jobs: | ||
semver-label: | ||
name: Semver Auto-Label | ||
autolabel: | ||
name: Ensure Minimal Semver Labels | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Minimal Semver Labels | ||
uses: mheap/github-action-required-labels@v1 | ||
with: | ||
count: 1 | ||
labels: semver:major, semver:minor, semver:patch | ||
mode: exactly | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Auto-label Semver | ||
if: ${{ failure() }} | ||
uses: paketo-buildpacks/github-config/actions/pull-request/auto-semver-label@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Copyright (c) 2018-Present CloudFoundry.org Foundation, Inc. All Rights Reserved. | ||
|
||
This project is licensed to you under the Apache License, Version 2.0 (the "License"). | ||
You may not use this project except in compliance with the License. | ||
|
||
This project may include a number of subcomponents with separate copyright notices | ||
and license terms. Your use of these subcomponents is subject to the terms and | ||
conditions of the subcomponent's license, as noted in the LICENSE file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,80 @@ | ||
# php-nginx | ||
PHP Nginx Cloud Native Buildpack | ||
# PHP Nginx Cloud Native Buildpack | ||
A Cloud Native Buildpack for configuring Nginx settings for PHP apps. | ||
|
||
The buildpack generates the Nginx configuration file with the minimal set of | ||
options to get Nginx to work with FPM (FastCGI Process Manager), and | ||
incorporates configuration from users and environment variables. The final | ||
Nginx configuration file is available at | ||
`/workspace/nginx.conf`, or locatable | ||
through the buildpack-set `$PHP_NGINX_PATH` environment variable at | ||
launch-time. | ||
|
||
## Integration | ||
|
||
The PHP Nginx CNB provides `php-nginx-config`, which can be required by subsequent | ||
buildpacks. In order to configure Nginx, the user must declare the intention to | ||
use Nginx as the web-server by setting the `$BP_PHP_SERVER` environment | ||
variable to `nginx` at build-time. | ||
|
||
```shell | ||
pack build my-nginx-app --env BP_PHP_SERVER="nginx" | ||
``` | ||
|
||
## Nginx Configuration Sources | ||
The base configuration file generated in this buildpack includes some default configuration, FPM-specific configuration, and | ||
has `include` sections for user-included configuration. | ||
|
||
#### FPM-specific Configuration | ||
This buildpack is written to provide Nginx configuration that should always be | ||
used in conjunction with FPM. The Nginx configuration file is generated to | ||
include FPM-specific configuration. This buildpack also sets up an FPM | ||
configuration file with Nginx-specific socket settings and makes it available | ||
in the `/workspace`. | ||
|
||
#### User Included Configuration | ||
User-included configuration should be found in the application source directory | ||
under `<app-directory>/.nginx.conf.d/`. Server-specific configuration should be | ||
inside a file named `*-server.conf`, and HTTP configuration should be inside a | ||
file with the naming structure `*-http.conf`. | ||
|
||
If files at these paths exist, it | ||
will be included in `include` sections at the appropriate places in the generated | ||
Nginx configuration. | ||
|
||
#### Environment Variables | ||
The following environment variables can be used to override default settings in | ||
the Nginx configuration file. | ||
|
||
| Variable | Default | | ||
| -------- | -------- | | ||
| `BP_PHP_ENABLE_HTTPS_REDIRECT` | true | | ||
| `BP_PHP_WEB_DIR` | htdocs | | ||
|
||
## Usage | ||
|
||
To package this buildpack for consumption: | ||
|
||
``` | ||
$ ./scripts/package.sh | ||
``` | ||
|
||
This builds the buildpack's Go source using `GOOS=linux` by default. You can | ||
supply another value as the first argument to `package.sh`. | ||
|
||
## Run Tests | ||
|
||
To run all unit tests, run: | ||
``` | ||
./scripts/unit.sh | ||
``` | ||
|
||
To run all integration tests, run: | ||
``` | ||
./scripts/integration.sh | ||
``` | ||
|
||
## Debug Logs | ||
For extra debug logs from the image build process, set the `$BP_LOG_LEVEL` | ||
environment variable to `DEBUG` at build-time (ex. `pack build my-app --env | ||
BP_LOG_LEVEL=DEBUG` or through a [`project.toml` | ||
file](https://github.com/buildpacks/spec/blob/main/extensions/project-descriptor.md). |
Oops, something went wrong.