Skip to content

Commit

Permalink
Merge pull request #5 from crshanks/crshanks-toplevel-deploy-script
Browse files Browse the repository at this point in the history
Crshanks toplevel deploy script
  • Loading branch information
crshanks authored Dec 19, 2024
2 parents fd3b89a + 5af2e36 commit 57dea61
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 10 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ If the environment variables are not set, they can alternatively be provided in
* [props.sh](props.sh)
* deploy.sh for each of the proxies

### Deploying the properties file, shared flows and example proxies in a single script
With the environment variables set, run [deploy.sh](deploy.sh).

### Shared flows
The instrumentation examples in this repository make use of [shared flows](https://cloud.google.com/apigee/docs/api-platform/fundamentals/shared-flows).

Expand All @@ -44,16 +47,16 @@ Example API proxies are contained in the [examples](examples) directory. The exa
* nr-metric-api-sharedflow
* nr-trace-api-sharedflow

To install the shared flows:
To install the shared flows independently:
1. Execute the [deploy.sh](sharedflows/src/gateway/nr-instrumentation-obfuscation-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-instrumentation-obfuscation-sharedflow](sharedflows/src/gateway/nr-instrumentation-obfuscation-sharedflow) directory.
2. Execute the [deploy.sh](sharedflows/src/gateway/nr-instrumentation-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-instrumentation-sharedflow](sharedflows/src/gateway/nr-instrumentation-sharedflow) directory.
3. Execute the [deploy.sh](sharedflows/src/gateway/nr-log-api-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-log-api-sharedflow](sharedflows/src/gateway/nr-log-api-sharedflow) directory.
4. Execute the [deploy.sh](sharedflows/src/gateway/nr-logging-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-logging-sharedflow](sharedflows/src/gateway/nr-logging-sharedflow) directory.
5. Execute the [deploy.sh](sharedflows/src/gateway/nr-metric-api-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-metric-api-sharedflow](sharedflows/src/gateway/nr-metric-api-sharedflow) directory.
6. Execute the [deploy.sh](sharedflows/src/gateway/nr-trace-api-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-trace-api-sharedflow](sharedflows/src/gateway/nr-trace-api-sharedflow) directory.

### Example flow
To install the example flows:
### Example proxies
To install the example proxies independently:
1. Execute the [deploy.sh](examples/newrelic-log/deploy.sh) script from within the [examples/newrelic-log](examples/newrelic-log) directory.
2. Execute the [deploy.sh](examples/newrelic-logging/deploy.sh) script from within the [examples/newrelic-logging](examples/newrelic-logging) directory.
3. Execute the [deploy.sh](examples/newrelic-metric/deploy.sh) script from within the [examples/newrelic-metric](examples/newrelic-metric) directory.
Expand Down
52 changes: 52 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

cd $SCRIPT_DIR

# Create a property set
./props.sh -c

# Sharedflows
echo "Deploying sharedflows..."
echo "Deploying nr-instrumentation-obfuscation-sharedflow..."
cd $SCRIPT_DIR/sharedflows/src/gateway/nr-instrumentation-obfuscate-sharedflow
./deploy.sh
echo "Deploying nr-instrumentation-sharedflow..."
cd $SCRIPT_DIR/sharedflows/src/gateway/nr-instrumentation-sharedflow
./deploy.sh
echo "Deploying nr-log-api-sharedflow..."
cd $SCRIPT_DIR/sharedflows/src/gateway/nr-log-api-sharedflow
./deploy.sh
echo "Deploying nr-logging-api-sharedflow..."
cd $SCRIPT_DIR/sharedflows/src/gateway/nr-logging-sharedflow
./deploy.sh
echo "Deploying nr-metric-sharedflow..."
cd $SCRIPT_DIR/sharedflows/src/gateway/nr-metric-api-sharedflow
./deploy.sh
echo "Deploying nr-trace-api-sharedflow..."
cd $SCRIPT_DIR/sharedflows/src/gateway/nr-trace-api-sharedflow
./deploy.sh
echo "Completed deploying sharedflows"

# Examples
echo "Deploying examples..."
echo "Deploying newrelic-logging example proxy..."
cd $SCRIPT_DIR/examples/newrelic-logging
./deploy.sh
echo "Deploying newrelic-metric example proxy..."
cd $SCRIPT_DIR/examples/newrelic-metric
./deploy.sh
echo "Deploying newrelic-trace example proxy..."
cd $SCRIPT_DIR/examples/newrelic-trace
./deploy.sh
echo "Deploying newrelic-trace-and-logging example proxy..."
cd $SCRIPT_DIR/examples/newrelic-trace-and-logging
./deploy.sh
echo "Deploying newrelic-trace-and-metric example proxy..."
cd $SCRIPT_DIR/examples/newrelic-trace-and-metric-and-log
./deploy.sh
echo "Deploying newrelic-trace-and-metric-and-log-obfuscate example proxy..."
cd $SCRIPT_DIR/examples/newrelic-trace-and-metric-and-log-obfuscate
./deploy.sh
echo "Completed deploying examples"
2 changes: 1 addition & 1 deletion examples/newrelic-log/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "https://swapi.dev/api/people/1/?format=json"
"value": "https://swapi.py4e.com/api/people/1/?format=json"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/newrelic-logging/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "https://swapi.dev/api/people/1/?format=json"
"value": "https://swapi.py4e.com/api/people/1/?format=json"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/newrelic-metric/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "https://swapi.dev/api/people/1/?format=json"
"value": "https://swapi.py4e.com/api/people/1/?format=json"
}
]
}
Expand Down
30 changes: 30 additions & 0 deletions examples/newrelic-mimecast-risk-assessment/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"configurations": [
{
"name": "test",
"policies": [],
"proxies": [
{
"name": "default.xml",
"tokens": [
{
"xpath": "/ProxyEndpoint/HTTPProxyConnection/BasePath",
"value": "/newrelic/mimecast-risk-assessment"
}
]
}
],
"targets": [
{
"name": "backend.xml",
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "http://ec2-3-236-183-93.compute-1.amazonaws.com:8082/riskAssessmentService"
}
]
}
]
}
]
}
2 changes: 1 addition & 1 deletion examples/newrelic-trace-and-logging/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "https://swapi.dev/api/people/1/?format=json"
"value": "https://swapi.py4e.com/api/people/1/?format=json"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "https://swapi.dev/api/people/1/?format=json"
"value": "https://swapi.py4e.com/api/people/1/?format=json"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/newrelic-trace-and-metric-and-log/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "https://swapi.dev/api/people/1/?format=json"
"value": "https://swapi.py4e.com/api/people/1/?format=json"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/newrelic-trace/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tokens": [
{
"xpath": "/TargetEndpoint/HTTPTargetConnection/URL",
"value": "https://swapi.dev/api/people/1/?format=json"
"value": "https://swapi.py4e.com/api/people/1/?format=json"
}
]
}
Expand Down

0 comments on commit 57dea61

Please sign in to comment.