Skip to content

Commit e4bc1cf

Browse files
DIGITAL-359: Implement New Relic.
1 parent 3763370 commit e4bc1cf

File tree

4 files changed

+28
-23
lines changed

4 files changed

+28
-23
lines changed

.github/workflows/cloudgov-deploy-app.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ jobs:
7070
- name: Deploy App
7171
env:
7272
PROJECT: "${{ secrets.PROJECT }}"
73-
run: source ./scripts/pipeline/cloud-gov-deploy.sh
73+
run: |
74+
app_guid=$(cf app --guid ${PROJECT}-drupal-${CF_SPACE}) cf curl -X POST /v3/apps/${app_guid}/actions/clear_buildpack_cache
75+
source ./scripts/pipeline/cloud-gov-deploy.sh
7476
- name: Post Deploy
7577
env:
7678
PROJECT: "${{ secrets.PROJECT }}"

apt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ packages:
88
#- awscli
99
- bsdmainutils
1010
- mysql-client
11-
#- newrelic-php5
11+
- newrelic-php5

scripts/bootstrap.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,22 @@ if [ -z "${VCAP_SERVICES:-}" ]; then
2121
fi
2222

2323
## NewRelic configuration
24-
# export newrelic_apt="${apt_path}/usr/lib/newrelic-php5"
25-
# export newrelic_app="${app_path}/newrelic/"
24+
export newrelic_apt="${apt_path}/usr/lib/newrelic-php5"
25+
export newrelic_app="${app_path}/newrelic/"
2626

27-
# rm -rf ${newrelic_app}/agent
28-
# ln -s ${newrelic_apt}/agent ${newrelic_app}/agent
27+
rm -rf ${newrelic_app}/agent
28+
ln -s ${newrelic_apt}/agent ${newrelic_app}/agent
2929

30-
# rm -f ${newrelic_app}/daemon/newrelic-daemon.x64
31-
# ln -s ${apt_path}/usr/bin/newrelic-daemon ${newrelic_app}/daemon/newrelic-daemon.x64
30+
rm -f ${newrelic_app}/daemon/newrelic-daemon.x64
31+
ln -s ${apt_path}/usr/bin/newrelic-daemon ${newrelic_app}/daemon/newrelic-daemon.x64
3232

33-
# rm -f ${app_path}/newrelic/scripts/newrelic-iutil.x64
34-
# ln -s ${newrelic_apt}/scripts/newrelic-iutil.x64 ${newrelic_app}/scripts/newrelic-iutil.x64
33+
rm -f ${app_path}/newrelic/scripts/newrelic-iutil.x64
34+
ln -s ${newrelic_apt}/scripts/newrelic-iutil.x64 ${newrelic_app}/scripts/newrelic-iutil.x64
3535

36-
#echo 'newrelic.daemon.collector_host=gov-collector.newrelic.com' >> ${app_path}/php/etc/php.ini
36+
echo 'newrelic.daemon.collector_host=gov-collector.newrelic.com' >> ${app_path}/php/etc/php.ini
37+
echo "newrelic.license=${NEWRELIC_KEY}" >> ${app_path}/php/etc/php.ini
3738

38-
source ${app_path}/scripts/bash_exports.sh
39+
source "${app_path}/scripts/bash_exports.sh"
3940

4041
if [ ! -f ./container_start_timestamp ]; then
4142
touch ./container_start_timestamp
@@ -56,8 +57,6 @@ done
5657
## Updated ~/.bashrc to update $PATH when someone logs in.
5758
[ -z "$(cat ${home}/.bashrc | grep PATH)" ] && \
5859
touch ${home}/.bashrc && \
59-
#echo "export http_proxy=${http_proxy}" >> ${home}/.bashrc && \
60-
#echo "export https_proxy=${https_proxy}" >> ${home}/.bashrc && \
6160
echo "alias nano=\"${home}/deps/0/apt/bin/nano\"" >> ${home}/.bashrc && \
6261
echo "PATH=$PATH:/home/vcap/app/php/bin:/home/vcap/app/vendor/drush/drush" >> /home/vcap/.bashrc
6362

scripts/cloud-gov-s3-creds.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,29 @@ echo "Creating key..."
3333
aws_bucket_name=$(echo "${s3_credentials}" | jq -r '.credentials.bucket')
3434
aws_bucket_region=$(echo "${s3_credentials}" | jq -r '.credentials.region')
3535
aws_secret_key=$(echo "${s3_credentials}" | jq -r '.credentials.secret_access_key')
36+
37+
declare AWS_ACCESS_KEY_ID
3638
export AWS_ACCESS_KEY_ID=${aws_access_key}
39+
40+
declare AWS_BUCKET
3741
export AWS_BUCKET=${aws_bucket_name}
42+
43+
declare AWS_DEFAULT_REGION
3844
export AWS_DEFAULT_REGION=${aws_bucket_region}
45+
46+
declare AWS_SECRET_ACCESS_KEY
3947
export AWS_SECRET_ACCESS_KEY=${aws_secret_key}
4048

4149
cat >~/current_creds.sh << EOT
42-
export AWS_ACCESS_KEY_ID=${aws_access_key}
43-
export AWS_BUCKET=${aws_bucket_name}
44-
export AWS_DEFAULT_REGION=${aws_bucket_region}
45-
export AWS_SECRET_ACCESS_KEY=${aws_secret_key}
50+
export AWS_ACCESS_KEY_ID="${aws_access_key}"
51+
export AWS_BUCKET="${aws_bucket_name}"
52+
export AWS_DEFAULT_REGION="${aws_bucket_region}"
53+
export AWS_SECRET_ACCESS_KEY="${aws_secret_key}"
4654
EOT
4755
chmod +x ~/current_creds.sh
4856
} >/dev/null 2>&1
4957

50-
declare eror >/dev/null 2>&1
51-
52-
[ -z "${AWS_ACCESS_KEY_ID}" ] && eror=true
53-
54-
if [ -n "${eror}" ]; then
58+
if [ -z "${AWS_ACCESS_KEY_ID}" ]; then
5559
echo -e "Error setting AWS credentials."
5660
echo -e "Please ensure you're logged in to Cloud.gov."
5761
echo -e "You can check by running: cf target -s <space_name>"

0 commit comments

Comments
 (0)