Skip to content

Commit 500fa6e

Browse files
committed
🧠 Add monthly ccloud costs at the end of playground run when ccloud example is executed #6410
1 parent cc9b119 commit 500fa6e

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

scripts/cli/playground

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10151,6 +10151,9 @@ function bootstrap_ccloud_environment () {
1015110151
confluent login --save
1015210152
fi
1015310153

10154+
playground ccloud-costs-history > /tmp/ccloud-costs-history.txt &
10155+
playground ccloud-costs-history --detailed > /tmp/ccloud-costs-history-detailed.txt &
10156+
1015410157
suggest_use_previous_example_ccloud=1
1015510158
test_file=$(playground state get run.test_file)
1015610159

@@ -15876,6 +15879,19 @@ playground_run_command() {
1587615879
fi
1587715880
check_for_ec2_instance_running
1587815881

15882+
if [[ $test_file == *"ccloud"* ]]
15883+
then
15884+
if [ -f /tmp/ccloud-costs-history.txt ]
15885+
then
15886+
log "📅💰 monthly ccloud costs"
15887+
cat /tmp/ccloud-costs-history.txt
15888+
fi
15889+
if [ -f /tmp/ccloud-costs-history-detailed.txt ]
15890+
then
15891+
log "👀 if you want more details, open /tmp/ccloud-costs-history-detailed.txt file"
15892+
fi
15893+
fi
15894+
1587915895
if [ ! -z "$ENABLE_JMX_GRAFANA" ]
1588015896
then
1588115897
log "🛡️ Prometheus is reachable at http://127.0.0.1:9090"

scripts/cli/src/commands/run.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,6 +1587,19 @@ else
15871587
fi
15881588
check_for_ec2_instance_running
15891589

1590+
if [[ $test_file == *"ccloud"* ]]
1591+
then
1592+
if [ -f /tmp/ccloud-costs-history.txt ]
1593+
then
1594+
log "📅💰 monthly ccloud costs"
1595+
cat /tmp/ccloud-costs-history.txt
1596+
fi
1597+
if [ -f /tmp/ccloud-costs-history-detailed.txt ]
1598+
then
1599+
log "👀 if you want more details, open /tmp/ccloud-costs-history-detailed.txt file"
1600+
fi
1601+
fi
1602+
15901603
if [ ! -z "$ENABLE_JMX_GRAFANA" ]
15911604
then
15921605
log "🛡️ Prometheus is reachable at http://127.0.0.1:9090"

scripts/cli/src/lib/utils_function.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,6 +1745,9 @@ function bootstrap_ccloud_environment () {
17451745
confluent login --save
17461746
fi
17471747

1748+
playground ccloud-costs-history > /tmp/ccloud-costs-history.txt &
1749+
playground ccloud-costs-history --detailed > /tmp/ccloud-costs-history-detailed.txt &
1750+
17481751
suggest_use_previous_example_ccloud=1
17491752
test_file=$(playground state get run.test_file)
17501753

0 commit comments

Comments
 (0)