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 77d3fb4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
10 changes: 10 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.3"

[[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.3"

[[order.group]]
id = "paketo-buildpacks/php-dist"
version = "2.1.12"
Expand Down
12 changes: 7 additions & 5 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 All @@ -144,8 +146,8 @@ func testPhpHttpd(t *testing.T, context spec.G, it spec.S) {
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Environment Variables")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Image Labels")))

Expect(image.Buildpacks[9].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[9].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "stew-peas"}))
Expect(image.Buildpacks[10].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[10].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "stew-peas"}))
Expect(image.Labels["cool-label"]).To(Equal("cool-value"))
})
})
Expand Down
12 changes: 7 additions & 5 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 All @@ -145,8 +147,8 @@ func testPhpNginx(t *testing.T, context spec.G, it spec.S) {
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Environment Variables")))
Expect(logs).To(ContainLines(ContainSubstring("Paketo Buildpack for Image Labels")))

Expect(image.Buildpacks[9].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[9].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "fish-n-chips"}))
Expect(image.Buildpacks[10].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[10].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "fish-n-chips"}))
Expect(image.Labels["cool-label"]).To(Equal("cool-value"))
})
})
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 77d3fb4

Please sign in to comment.