Skip to content

Commit

Permalink
com
Browse files Browse the repository at this point in the history
  • Loading branch information
dpacheconr committed Oct 18, 2024
1 parent 70f6d73 commit 5ed14d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 12 additions & 2 deletions .devcontainer/otel-astro/configure_environment.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/usr/bin/env bash
DEMOVERSION="20241002"

main() {
# If the argument is empty then run both functions else only run provided function as argument $1.
[ -z "$1" ] && { build_frontend; create_cluster; } || $1
# If the argument is empty then run all functions else only run provided function as argument $1.
[ -z "$1" ] && { nrheartbeat; build_frontend; create_cluster; } || $1
}

nrheartbeat () {
export hdemoversion=$DEMOVERSION
export hbuid=$(uuidgen)
hbmachinecreated=$(date +%s)
hbhostversion=$(. /etc/os-release; echo "$VERSION" | tr -d '[:blank:]')
hbhostname=$(. /etc/os-release; echo "$NAME" | tr -d '[:blank:]')
curl -k "https://f6zxc2425pz4vbuidpknebsz7q0viifd.lambda-url.eu-west-2.on.aws/?hbDemoVersion=$hdemoversion&identifier=$hbuid&hbHostVersion=$hbhostversion&hbHostname=$hbhostname&hbMachineCreated=$hbmachinecreated"
}

build_frontend () {
Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/otel-astro/install_demo.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
DEMOVERSION="20241002"

main() {
# Check if the script has been run before
Expand Down Expand Up @@ -153,7 +152,7 @@ deploy_demo () {
hbhostname=$(. /etc/os-release; echo "$NAME" | tr -d '[:blank:]')
hbaccountid=$( echo "$accountId" | tr -d '[:blank:]')
# Applies if does not exist or warns if exists, this is intentional to avoid uid being replaced on each time it runs
kubectl create configmap nrheartbeat --from-literal=hbaccountid=$hbaccountid --from-literal=hbdemoversion=$DEMOVERSION --from-literal=hbuid=$(uuidgen) --from-literal=hbhostversion=$hbhostversion --from-literal=hbhostname=$hbhostname --from-literal=hbselfhosted=$hbselfhosted --from-literal=hbstarttime=$hbstarttime
kubectl create configmap nrheartbeat --from-literal=hbaccountid=$hbaccountid --from-literal=hbdemoversion=$DEMOVERSION --from-literal=hbuid=$hbuid --from-literal=hbhostversion=$hbhostversion --from-literal=hbhostname=$hbhostname --from-literal=hbselfhosted=$hbselfhosted --from-literal=hbstarttime=$hbstarttime
kubectl apply -f ./hbcronjob.yaml


Expand Down

0 comments on commit 5ed14d8

Please sign in to comment.