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

support integration with python family buildpacks #86

Merged
merged 1 commit into from
Oct 30, 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
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