Skip to content

Commit

Permalink
Updated script to apply Splunk-specific README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitchsplunk committed Dec 22, 2023
1 parent cdc929c commit d3da817
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![Commits](https://img.shields.io/github/commits-since/open-telemetry/opentelemetry-demo/latest?color=ff69b4&include_prereleases)](https://github.com/open-telemetry/opentelemetry-demo/graphs/commit-activity)
[![Downloads](https://img.shields.io/docker/pulls/otel/demo)](https://hub.docker.com/r/otel/demo)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg?color=red)](https://github.com/open-telemetry/opentelemetry-demo/blob/main/LICENSE)
[![Integration Tests](https://github.com/open-telemetry/opentelemetry-demo/actions/workflows/run-integration-tests.yml/badge.svg)](https://github.com/open-telemetry/opentelemetry-demo/actions/workflows/run-integration-tests.yml)

## Welcome to the OpenTelemetry Astronomy Shop Demo

Expand Down Expand Up @@ -33,6 +34,10 @@ guidance](./CONTRIBUTING.md).
If you'd like to extend this demo or maintain a fork of it, read our
[fork guidance](https://opentelemetry.io/docs/demo/forking/).

## Splunk customizations

A number of customizations have been made to use the demo application with Splunk Observability Cloud, which can be found in the [/splunk](./splunk) folder. See [this document](./splunk/README.md) for details.

## Quick start

You can be up and running with the demo in a few minutes. Check out the docs for
Expand Down
5 changes: 2 additions & 3 deletions splunk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ This repository contains a fork of the OpenTelemetry Astronomy Shop, a microserv
distributed system intended to illustrate the implementation of OpenTelemetry in
a near real-world environment. It includes customizations for use with Splunk Observability Cloud.


## Update Docker and Kubernetes Scripts

After synchronizing changes with the upstream repository, the following command can be used to update the Splunk versions of the docker-compose.yml and kubernetes/opentelemetry-demo.yaml files, which are optimized for use with Splunk Observability Cloud:

````
```bash
./update-demos.sh
````
```

## Quick start

Expand Down
21 changes: 21 additions & 0 deletions splunk/update-demos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@ set -euo pipefail
# Set default paths if environment variables are not set
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

function update_root_readme {
ROOT_README_PATH=${ROOT_README_PATH:-"$SCRIPT_DIR/../README.md"}

# Download the latest README file from upstream
curl -L https://raw.githubusercontent.com/open-telemetry/opentelemetry-demo/main/README.md \
> "$ROOT_README_PATH"

# add a section to the root README file with a pointer to Splunk customizations
SEARCH_VAL="## Quick start"
REPLACE_VAL='## Splunk customizations \
\
A number of customizations have been made to use the demo application with Splunk Observability Cloud, which can be found in the \[\/splunk\](\.\/splunk) folder. See \[this document\](\.\/splunk\/README.md) for details. \
\
## Quick start'

sed -i '' "s/${SEARCH_VAL}/${REPLACE_VAL}/g" "$ROOT_README_PATH"

echo "Completed updating the root README.md file for the OpenTelemetry demo app!"
}

function update_otel_demo_docker {
DOCKER_COMPOSE_PATH=${DOCKER_COMPOSE_PATH:-"$SCRIPT_DIR/../docker-compose.yml"}
SPLUNK_DOCKER_COMPOSE_PATH=${SPLUNK_DOCKER_COMPOSE_PATH:-"$SCRIPT_DIR/../splunk/docker-compose.yml"}
Expand Down Expand Up @@ -104,5 +124,6 @@ function update_otel_demo_k8s {
}

# ---- OpenTelemetry Demo Update ----
update_root_readme
update_otel_demo_docker
update_otel_demo_k8s

0 comments on commit d3da817

Please sign in to comment.