Skip to content

Commit

Permalink
add watchexec buildpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Wigmore committed Oct 9, 2023
1 parent e7e7fcf commit b3d4748
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
15 changes: 15 additions & 0 deletions buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ api = "0.7"
optional = true
version = "3.6.3"

[[order.group]]
id = "paketo-buildpacks/watchexec"
optional = true
version = "2.8.5"

[[order.group]]
id = "paketo-buildpacks/php-dist"
version = "2.1.12"
Expand Down Expand Up @@ -81,6 +86,11 @@ api = "0.7"
optional = true
version = "3.6.3"

[[order.group]]
id = "paketo-buildpacks/watchexec"
optional = true
version = "2.8.5"

[[order.group]]
id = "paketo-buildpacks/php-dist"
version = "2.1.12"
Expand Down Expand Up @@ -138,6 +148,11 @@ api = "0.7"

[[order]]

[[order.group]]
id = "paketo-buildpacks/watchexec"
optional = true
version = "2.8.5"

[[order.group]]
id = "paketo-buildpacks/php-dist"
version = "2.1.12"
Expand Down
8 changes: 5 additions & 3 deletions integration/builtin_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ func testPhpBuiltinServer(t *testing.T, context spec.G, it spec.S) {
WithBuildpacks(phpBuildpack).
WithPullPolicy("never").
WithEnv(map[string]string{
"BP_PHP_WEB_DIR": "htdocs",
"BPE_SOME_VARIABLE": "stew-peas",
"BP_IMAGE_LABELS": "cool-label=cool-value",
"BP_PHP_WEB_DIR": "htdocs",
"BPE_SOME_VARIABLE": "stew-peas",
"BP_IMAGE_LABELS": "cool-label=cool-value",
"BP_LIVE_RELOAD_ENABLED": "true",
}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred(), logs.String())
Expand All @@ -114,6 +115,7 @@ func testPhpBuiltinServer(t *testing.T, context spec.G, it spec.S) {
Eventually(container).Should(Serve(ContainSubstring("SUCCESS: date loads.")).OnPort(8080).WithEndpoint("/index.php?date"))
Expect(logs).To(ContainLines(ContainSubstring(`web: php -S 0.0.0.0:"${PORT:-80}" -t htdocs && echo hi`)))

Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Watchexec")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for PHP Distribution")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Composer")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Composer Install")))
Expand Down
8 changes: 5 additions & 3 deletions integration/httpd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ func testPhpHttpd(t *testing.T, context spec.G, it spec.S) {
WithBuildpacks(phpBuildpack).
WithPullPolicy("never").
WithEnv(map[string]string{
"BP_PHP_SERVER": "httpd",
"BPE_SOME_VARIABLE": "stew-peas",
"BP_IMAGE_LABELS": "cool-label=cool-value",
"BP_PHP_SERVER": "httpd",
"BPE_SOME_VARIABLE": "stew-peas",
"BP_IMAGE_LABELS": "cool-label=cool-value",
"BP_LIVE_RELOAD_ENABLED": "true",
}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred(), logs.String())
Expand All @@ -133,6 +134,7 @@ func testPhpHttpd(t *testing.T, context spec.G, it spec.S) {
Eventually(container).Should(Serve(ContainSubstring("SUCCESS: date loads.")).OnPort(8080).WithEndpoint("/index.php?date"))
Expect(logs).To(ContainLines(ContainSubstring("web: php-fpm -y $PHP_FPM_PATH & httpd -f $PHP_HTTPD_PATH -k start -DFOREGROUND && echo hi")))

Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Watchexec")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for PHP Distribution")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Composer")))
Expand Down
8 changes: 5 additions & 3 deletions integration/nginx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ func testPhpNginx(t *testing.T, context spec.G, it spec.S) {
WithBuildpacks(phpBuildpack).
WithPullPolicy("never").
WithEnv(map[string]string{
"BP_PHP_SERVER": "nginx",
"BPE_SOME_VARIABLE": "fish-n-chips",
"BP_IMAGE_LABELS": "cool-label=cool-value",
"BP_PHP_SERVER": "nginx",
"BPE_SOME_VARIABLE": "fish-n-chips",
"BP_IMAGE_LABELS": "cool-label=cool-value",
"BP_LIVE_RELOAD_ENABLED": "true",
}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred(), logs.String())
Expand All @@ -133,6 +134,7 @@ func testPhpNginx(t *testing.T, context spec.G, it spec.S) {
Eventually(container).Should(Serve(ContainSubstring("SUCCESS: date loads.")).OnPort(8080).WithEndpoint("/index.php?date"))

Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for CA Certificates")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Watchexec")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for PHP Distribution")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Composer")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Composer Install")))
Expand Down
3 changes: 3 additions & 0 deletions package.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@

[[dependencies]]
uri = "urn:cnb:registry:paketo-buildpacks/ca-certificates@3.6.3"

[[dependencies]]
uri = "urn:cnb:registry:paketo-buildpacks/watchexec@2.8.3"

0 comments on commit b3d4748

Please sign in to comment.