Skip to content

Commit

Permalink
add watchexec to python language family
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankie Gallina-Jones authored and arjun024 committed Nov 11, 2021
1 parent 9713200 commit 262f3df
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 16 deletions.
20 changes: 20 additions & 0 deletions buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ api = "0.6"
optional = true
version = "2.4.2"

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

[[order.group]]
id = "paketo-buildpacks/cpython"
version = "0.7.3"
Expand Down Expand Up @@ -56,6 +61,11 @@ api = "0.6"
optional = true
version = "2.4.2"

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

[[order.group]]
id = "paketo-buildpacks/cpython"
version = "0.7.3"
Expand Down Expand Up @@ -94,6 +104,11 @@ api = "0.6"
optional = true
version = "2.4.2"

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

[[order.group]]
id = "paketo-buildpacks/miniconda"
version = "0.2.1"
Expand Down Expand Up @@ -128,6 +143,11 @@ api = "0.6"
optional = true
version = "2.4.2"

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

[[order.group]]
id = "paketo-buildpacks/cpython"
version = "0.7.3"
Expand Down
10 changes: 6 additions & 4 deletions integration/conda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ func testConda(t *testing.T, context spec.G, it spec.S) {
WithBuildpacks(pythonBuildpack).
WithPullPolicy("never").
WithEnv(map[string]string{
"BPE_SOME_VARIABLE": "some-value",
"BP_IMAGE_LABELS": "some-label=some-value",
"BPE_SOME_VARIABLE": "some-value",
"BP_IMAGE_LABELS": "some-label=some-value",
"BP_LIVE_RELOAD_ENABLED": "true",
}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred(), logs.String())
Expand Down Expand Up @@ -95,9 +96,10 @@ func testConda(t *testing.T, context spec.G, it spec.S) {
Expect(logs).To(ContainLines(ContainSubstring("Procfile Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Environment Variables Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Image Labels Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Watchexec Buildpack")))

Expect(image.Buildpacks[5].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[5].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"}))
Expect(image.Buildpacks[6].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[6].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"}))
Expect(image.Labels["some-label"]).To(Equal("some-value"))
})

Expand Down
10 changes: 6 additions & 4 deletions integration/no_package_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ func testNoPackageManager(t *testing.T, context spec.G, it spec.S) {
WithBuildpacks(pythonBuildpack).
WithPullPolicy("never").
WithEnv(map[string]string{
"BPE_SOME_VARIABLE": "some-value",
"BP_IMAGE_LABELS": "some-label=some-value",
"BPE_SOME_VARIABLE": "some-value",
"BP_IMAGE_LABELS": "some-label=some-value",
"BP_LIVE_RELOAD_ENABLED": "true",
}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred(), logs.String())
Expand All @@ -106,9 +107,10 @@ func testNoPackageManager(t *testing.T, context spec.G, it spec.S) {
Expect(logs).To(ContainLines(ContainSubstring("Procfile Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Environment Variables Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Image Labels Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Watchexec Buildpack")))

Expect(image.Buildpacks[4].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[4].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"}))
Expect(image.Buildpacks[5].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[5].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"}))
Expect(image.Labels["some-label"]).To(Equal("some-value"))

container, err = docker.Container.Run.Execute(image.ID)
Expand Down
10 changes: 6 additions & 4 deletions integration/pip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ func testPip(t *testing.T, context spec.G, it spec.S) {
WithBuildpacks(pythonBuildpack).
WithPullPolicy("never").
WithEnv(map[string]string{
"BPE_SOME_VARIABLE": "some-value",
"BP_IMAGE_LABELS": "some-label=some-value",
"BPE_SOME_VARIABLE": "some-value",
"BP_IMAGE_LABELS": "some-label=some-value",
"BP_LIVE_RELOAD_ENABLED": "true",
}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred(), logs.String())
Expand Down Expand Up @@ -96,9 +97,10 @@ func testPip(t *testing.T, context spec.G, it spec.S) {
Expect(logs).To(ContainLines(ContainSubstring("Procfile Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Environment Variables Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Image Labels Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Watchexec Buildpack")))

Expect(image.Buildpacks[6].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[6].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"}))
Expect(image.Buildpacks[7].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[7].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"}))
Expect(image.Labels["some-label"]).To(Equal("some-value"))
})

Expand Down
10 changes: 6 additions & 4 deletions integration/pipenv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ func testPipenv(t *testing.T, context spec.G, it spec.S) {
WithBuildpacks(pythonBuildpack).
WithPullPolicy("never").
WithEnv(map[string]string{
"BPE_SOME_VARIABLE": "some-value",
"BP_IMAGE_LABELS": "some-label=some-value",
"BPE_SOME_VARIABLE": "some-value",
"BP_IMAGE_LABELS": "some-label=some-value",
"BP_LIVE_RELOAD_ENABLED": "true",
}).
Execute(name, source)
Expect(err).NotTo(HaveOccurred(), logs.String())
Expand Down Expand Up @@ -97,9 +98,10 @@ func testPipenv(t *testing.T, context spec.G, it spec.S) {
Expect(logs).To(ContainLines(ContainSubstring("Procfile Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Environment Variables Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Image Labels Buildpack")))
Expect(logs).To(ContainLines(ContainSubstring("Watchexec Buildpack")))

Expect(image.Buildpacks[7].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[7].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"}))
Expect(image.Buildpacks[8].Key).To(Equal("paketo-buildpacks/environment-variables"))
Expect(image.Buildpacks[8].Layers["environment-variables"].Metadata["variables"]).To(Equal(map[string]interface{}{"SOME_VARIABLE": "some-value"}))
Expect(image.Labels["some-label"]).To(Equal("some-value"))
})

Expand Down
3 changes: 3 additions & 0 deletions package.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@

[[dependencies]]
uri = "docker://gcr.io/paketo-buildpacks/image-labels:3.2.3"

[[dependencies]]
uri = "docker://gcr.io/paketo-buildpacks/watchexec:1.2.0"

0 comments on commit 262f3df

Please sign in to comment.