Skip to content

Commit

Permalink
Merge pull request #86 from arjun024/add-python-support
Browse files Browse the repository at this point in the history
support integration with python family buildpacks
  • Loading branch information
dmikusa authored Oct 30, 2023
2 parents d52caa5 + d9a17f1 commit 47defb2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The binding must include the following required Secret values to successfully co
the API URL and API token secret keys support multiple casing options for ease of integration.
This buildpack will choose to use `api-url` over `apiurl` and `api-token` over `apitoken` if both are set.

The buildpack will do the following for .NET, Go, Apache HTTPd, Java, Nginx, NodeJS, and PHP applications:
The buildpack will do the following for .NET, Go, Apache HTTPD, Java, Nginx, NodeJS, PHP and Python applications:

* Contributes a OneAgent including the appropriate libraries to a layer and configures `$LD_PRELOAD` to use it
* Sets `$DT_TENANT`, `$DT_TENANTTOKEN`, and `$DT_CONNECTION_POINT` at launch time.
Expand Down
2 changes: 1 addition & 1 deletion buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ api = "0.7"
description = "A Cloud Native Buildpack that contributes the Dynatrace OneAgent and configures it to connect to the service"
homepage = "https://github.com/paketo-buildpacks/dynatrace"
id = "paketo-buildpacks/dynatrace"
keywords = ["dynatrace", "agent", "one-agent", "apm", "java", "node.js", "go", "apache-httpd", "nginx", "php", "dotnet"]
keywords = ["dynatrace", "agent", "one-agent", "apm", "java", "node.js", "go", "apache-httpd", "nginx", "php", "dotnet", "python"]
name = "Paketo Buildpack for Dynatrace"
sbom-formats = ["application/vnd.syft+json", "application/vnd.cyclonedx+json"]
version = "{{.version}}"
Expand Down
2 changes: 1 addition & 1 deletion dt/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) {

uri := fmt.Sprintf("%s/v1/deployment/installer/agent/unix/paas/latest?bitness=64&skipMetadata=true", BaseURI(s))

for _, t := range []string{"apache", "dotnet", "go", "java", "nginx", "nodejs", "php"} {
for _, t := range []string{"apache", "dotnet", "go", "java", "nginx", "nodejs", "php", "python"} {
if _, ok, err := pr.Resolve(fmt.Sprintf("dynatrace-%s", t)); err != nil {
return libcnb.BuildResult{}, fmt.Errorf("unable to resolve dynatrace-%s plan entry\n%w", t, err)
} else if ok {
Expand Down
9 changes: 9 additions & 0 deletions dt/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error
{Name: "php"},
},
},
{
Provides: []libcnb.BuildPlanProvide{
{Name: "dynatrace-python"},
},
Requires: []libcnb.BuildPlanRequire{
{Name: "dynatrace-python"},
{Name: "cpython"},
},
},
},
}, nil
}
9 changes: 9 additions & 0 deletions dt/detect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ var expectedResult = libcnb.DetectResult{
{Name: "php"},
},
},
{
Provides: []libcnb.BuildPlanProvide{
{Name: "dynatrace-python"},
},
Requires: []libcnb.BuildPlanRequire{
{Name: "dynatrace-python"},
{Name: "cpython"},
},
},
},
}

Expand Down

0 comments on commit 47defb2

Please sign in to comment.