|
| 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 |
0 commit comments