Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add watchexec buildpack #791

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"