Skip to content

Commit

Permalink
modify host IP
Browse files Browse the repository at this point in the history
  • Loading branch information
nasir19noor committed Jan 15, 2025
1 parent 70481f2 commit 93e3d21
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions cicd/internal/flags/it-flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,26 @@ func StageBucket() string {
return "-DstageBucket=" + dStageBucket
}

// func HostIp() string {
// if len(dHostIp) == 0 {
// gcloudCmd := "gcloud compute instances list | grep $(hostname) | awk '{print $4}'"
// if hostIP, err := exec.Command("bash", "-c", gcloudCmd).Output(); err != nil || len(hostIP) == 0 {
// panic(fmt.Errorf("failed to get gitactions runner host ip: %v", err))
// } else {
// return "-DhostIp=" + string(hostIP)[:len(hostIP)-1]
// }
// }
// return "-DhostIp=" + dHostIp
// }

func HostIp() string {
if len(dHostIp) == 0 {
return "-DhostIp=34.93.18.144"
gcloudCmd := "gcloud compute instances list | grep $(hostname) | awk '{print $4}'"
if hostIP, err := exec.Command("bash", "-c", gcloudCmd).Output(); err != nil || len(hostIP) == 0 {
panic(fmt.Errorf("failed to get gitactions runner host ip: %v", err))
} else {
// return "-DhostIp=" + string(hostIP)[:len(hostIP)-1]
return "-DhostIp=34.93.18.144"
}
}
return "-DhostIp=" + dHostIp
}

// func HostIp() string {
// if len(dHostIp) == 0 {
// return "-DhostIp=34.93.18.144"
// }
// return "-DhostIp=" + dHostIp
// }

func PrivateConnectivity() string {
if dPrivateConnectivity != "" {
return "-DprivateConnectivity=" + dPrivateConnectivity
Expand Down

0 comments on commit 93e3d21

Please sign in to comment.