Skip to content

Commit eb9a13c

Browse files
committed
Fix CI/CD, bump version to 1.10.0
1 parent 49debd4 commit eb9a13c

4 files changed

Lines changed: 42 additions & 18 deletions

File tree

.github/workflows/build-monitoring.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ---------------------------------------------------------------------------
66
# Coherence CLI GitHub Actions CI Build Monitoring
77
# ---------------------------------------------------------------------------
8-
name: Build Monitoring
8+
name: CI Build Monitoring
99

1010
on:
1111
workflow_dispatch:
@@ -64,8 +64,10 @@ jobs:
6464
cohctl start monitoring
6565
sleep 30
6666
cohctl get monitoring
67-
curl -s http://localhost:9090/-/healthy
68-
curl -s http://localhost:3000/api/health
67+
netstat -an | grep 9090
68+
netstat -an | grep 3000
69+
curl -s http://127.0.0.1:9090/-/healthy
70+
curl -s http://127.0.0.1:3000/api/health
6971
cohctl stop monitoring
7072
7173
- uses: actions/upload-artifact@v4

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# ======================================================================================================================
1616

1717
# The version of the CLI being build - this should be a valid SemVer format
18-
VERSION ?= 1.9.2
18+
VERSION ?= 1.10.0
1919
MILESTONE ?=
2020
SHELL := /bin/bash
2121

docs/sitegen.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ engine:
1111
attributes:
1212
plantumlconfig: "_plantuml-config.txt"
1313
commercial-docs-base-url: "https://docs.oracle.com/en/middleware/fusion-middleware/coherence/14.1.2"
14-
cli-version: "1.9.2"
14+
cli-version: "1.10.0"
1515
coherence-version: "14.1.2-0-2"
1616
coherence-default-version: "14.1.2-0-2"
1717
assets:
@@ -35,7 +35,7 @@ backend:
3535
name: "vuetify"
3636
homePage: "docs/about/overview.adoc"
3737
releases:
38-
- "1.9.2"
38+
- "1.10.0"
3939
navigation:
4040
type: "ROOT"
4141
title: "Coherence CLI"

pkg/cmd/monitoring.go

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ import (
2222
)
2323

2424
const (
25-
monitoringDirectory = "monitoring"
26-
dashboardsDirectory = "dashboards"
27-
dashboardBaseURL = "https://raw.githubusercontent.com/oracle/coherence-operator/refs/heads/main/dashboards/grafana"
28-
configBaseURL = "https://raw.githubusercontent.com/oracle/coherence-cli/refs/heads/main/monitoring"
29-
grafanaPort = 3000
30-
prometheusPort = 9090
31-
dockerComposeYAML = "docker-compose.yaml"
25+
monitoringDirectory = "monitoring"
26+
dashboardsDirectory = "dashboards"
27+
dashboardBaseURL = "https://raw.githubusercontent.com/oracle/coherence-operator/refs/heads/main/dashboards/grafana"
28+
configBaseURL = "https://raw.githubusercontent.com/oracle/coherence-cli/refs/heads/main/monitoring"
29+
grafanaPort = 3000
30+
prometheusPort = 9090
31+
dockerComposeYAML = "docker-compose.yaml"
32+
localhost = "127.0.0.1"
33+
useDockerComposeMessage = "use docker-compose instead of docker compose"
3234
)
3335

3436
var (
@@ -66,6 +68,8 @@ var (
6668
dockerComposeYAML,
6769
"prometheus.yaml",
6870
}
71+
72+
useDockerCompose bool
6973
)
7074

7175
// initMonitoringCmd represents the init monitoring command.
@@ -151,10 +155,10 @@ the environment is setup correctly.`,
151155
grafanaOutput string
152156
promOutput string
153157
err = mon.validateEnvironment()
154-
promURL = fmt.Sprintf("http://localhost:%v/", prometheusPort)
158+
promURL = fmt.Sprintf("http://%s:%v/", localhost, prometheusPort)
155159
promHealthURL = fmt.Sprintf("%s-/healthy", promURL)
156-
grafanaURL = fmt.Sprintf("http://localhost:%v/d/coh-main/coherence-dashboard-main", grafanaPort)
157-
grafanaHealthURL = fmt.Sprintf("http://localhost:%d/api/health", grafanaPort)
160+
grafanaURL = fmt.Sprintf("http://%s:%v/d/coh-main/coherence-dashboard-main", localhost, grafanaPort)
161+
grafanaHealthURL = fmt.Sprintf("http://%s:%d/api/health", localhost, grafanaPort)
158162
)
159163

160164
if err != nil {
@@ -211,7 +215,7 @@ Prometheus using docker compose.`,
211215
return err
212216
}
213217

214-
err = mon.dockerCommand([]string{"compose", "-f", path.Join(mon.monitoringDir, dockerComposeYAML), "up", "-d"})
218+
err = mon.dockerComposeCommand([]string{"-f", path.Join(mon.monitoringDir, dockerComposeYAML), "up", "-d"})
215219
if err != nil {
216220
return err
217221
}
@@ -244,7 +248,7 @@ using docker compose.`,
244248
return nil
245249
}
246250

247-
err = mon.dockerCommand([]string{"compose", "-f", path.Join(mon.monitoringDir, dockerComposeYAML), "down"})
251+
err = mon.dockerComposeCommand([]string{"-f", path.Join(mon.monitoringDir, dockerComposeYAML), "down"})
248252
if err != nil {
249253
return err
250254
}
@@ -392,6 +396,22 @@ func (m *monitoring) dockerCommand(args []string) error {
392396
return executeHostCommand(m.cmd, "docker", args...)
393397
}
394398

399+
func (m *monitoring) dockerComposeCommand(args []string) error {
400+
finalArgs := args
401+
command := "docker"
402+
403+
if useDockerCompose {
404+
command = "docker-compose"
405+
} else {
406+
updatedArgs := []string{"compose"}
407+
finalArgs = append(updatedArgs, args...)
408+
}
409+
410+
m.cmd.Printf("Issuing %s %s\n", command, strings.Join(finalArgs, " "))
411+
412+
return executeHostCommand(m.cmd, command, finalArgs...)
413+
}
414+
395415
func monitoringNotValid(message string) error {
396416
return fmt.Errorf("unable to validate monitoring due to %s, please run 'cohctl init monitoring'", message)
397417
}
@@ -454,4 +474,6 @@ func streamOutput(r io.Reader, w io.Writer) {
454474
func init() {
455475
initMonitoringCmd.Flags().BoolVarP(&automaticallyConfirm, "yes", "y", false, confirmOptionMessage)
456476
stopMonitoringCmd.Flags().BoolVarP(&automaticallyConfirm, "yes", "y", false, confirmOptionMessage)
477+
stopMonitoringCmd.Flags().BoolVarP(&useDockerCompose, "docker-compose", "D", false, useDockerComposeMessage)
478+
startMonitoringCmd.Flags().BoolVarP(&useDockerCompose, "docker-compose", "D", false, useDockerComposeMessage)
457479
}

0 commit comments

Comments
 (0)