Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Timepstamp in device name to be unique #15

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os/exec"
"strings"
"sync"
"time"

"github.com/bitrise-io/go-steputils/stepconf"
"github.com/bitrise-io/go-steputils/tools"
Expand Down Expand Up @@ -193,12 +194,14 @@ func main() {
adbSerialPortList = strings.Split(c.GMCloudSaaSAdbSerialPort, ",")
}

buildNumber := os.Getenv("BITRISE_BUILD_NUMBER")

workflowID := os.Getenv("BITRISE_TRIGGERED_WORKFLOW_ID")
log.Infof("Use workflow : %s ", workflowID)
log.Infof("Start %d Android instances on Genymotion Cloud SaaS", len(recipesList))
var wg sync.WaitGroup
t := time.Now().UnixNano()
for cptInstance := 0; cptInstance < len(recipesList); cptInstance++ {
instanceName := fmt.Sprint("gminstance_bitrise_", buildNumber, "_", cptInstance)
instanceName := fmt.Sprint("bitrise_", workflowID, "_", t, "_", cptInstance)
log.Infof("Start instance : %s on Genymotion Cloud SaaS", instanceName)
wg.Add(1)
if len(adbSerialPortList) >= 1 {
go startInstanceAndConnect(&wg, recipesList[cptInstance], instanceName, adbSerialPortList[cptInstance])
Expand All @@ -210,7 +213,7 @@ func main() {

for cptInstance := 0; cptInstance < len(recipesList); cptInstance++ {

instanceName := fmt.Sprint("gminstance_bitrise_", buildNumber, "_", cptInstance)
instanceName := fmt.Sprint("bitrise_", workflowID, "_", t, "_", cptInstance)
instanceUUID, InstanceADBSerialPort := getInstanceDetails(instanceName)

instancesList = append(instancesList, instanceUUID)
Expand Down