Skip to content

Commit fcf0876

Browse files
authored
Merge branch 'main' into fix-linter-ruff
2 parents 79a9d4a + 7800c21 commit fcf0876

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

scripts/azure-prebuild.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
# Copyright 2010 New Relic, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
#######################################################################
17+
# This script is used to prebuild the New Relic Python agent for Azure Web Apps.
18+
# It is executed in the Azure Web App environment before the app is started.
19+
#######################################################################
20+
21+
# Retrieve files to use in startup script:
22+
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/newrelic_k8s_operator.py > newrelic_k8s_operator.py
23+
curl -L https://raw.githubusercontent.com/newrelic/newrelic-agent-init-container/refs/heads/main/src/python/requirements-vendor.txt > requirements-vendor.txt
24+
25+
mkdir -p /home/.newrelic
26+
cd /home/.newrelic
27+
28+
export NEW_RELIC_EXTENSIONS=false
29+
export WRAPT_DISABLE_EXTENSIONS=true
30+
31+
pip install 'setuptools>=40.8.0' wheel
32+
pip install newrelic --target=./newrelic
33+
pip install --target=./vendor -r /home/site/wwwroot/requirements-vendor.txt
34+
35+
mv /home/site/wwwroot/newrelic_k8s_operator.py /home/.newrelic/newrelic/
36+
cp /home/.newrelic/newrelic/newrelic/bootstrap/sitecustomize.py /home/sitecustomize.py
37+
38+
cd /home/site/wwwroot

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def build_extension(self, ext):
180180
packages=packages,
181181
python_requires=">=3.7",
182182
package_data={
183-
"newrelic": ["newrelic.ini", "version.txt", "packages/urllib3/LICENSE.txt", "common/cacert.pem"],
183+
"newrelic": ["newrelic.ini", "version.txt", "packages/urllib3/LICENSE.txt", "common/cacert.pem", "scripts/azure-prebuild.sh"],
184184
},
185185
extras_require={"infinite-tracing": ["grpcio", "protobuf"]},
186186
)

0 commit comments

Comments
 (0)