本文整理汇总了Golang中github.com/bitrise-io/bitrise/models.BuildRunResultsModel.IsStepLibUpdated方法的典型用法代码示例。如果您正苦于以下问题:Golang BuildRunResultsModel.IsStepLibUpdated方法的具体用法?Golang BuildRunResultsModel.IsStepLibUpdated怎么用?Golang BuildRunResultsModel.IsStepLibUpdated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/bitrise-io/bitrise/models.BuildRunResultsModel
的用法示例。
在下文中一共展示了BuildRunResultsModel.IsStepLibUpdated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: activateAndRunSteps
//.........这里部分代码省略.........
}
} else if stepIDData.SteplibSource == "_" {
log.Debugf("[BITRISE_CLI] - Steplib independent step, with direct git uri: (uri:%s) (tag-or-branch:%s)", stepIDData.IDorURI, stepIDData.Version)
// Steplib independent steps are completly defined in workflow
stepYMLPth = ""
if err := workflowStep.FillMissingDefaults(); err != nil {
registerStepRunResults("", models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
if err := cmdex.GitCloneTagOrBranch(stepIDData.IDorURI, stepDir, stepIDData.Version); err != nil {
registerStepRunResults("", models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
stepInfoPtr.Version = "_"
if stepIDData.Version != "" {
if len(stepIDData.Version) > 20 {
stepInfoPtr.Version = stepInfoPtr.Version + "@..." + stringutil.MaxLastChars(stepIDData.Version, 17)
} else {
stepInfoPtr.Version = stepInfoPtr.Version + "@" + stepIDData.Version
}
}
} else if stepIDData.SteplibSource != "" {
log.Debugf("[BITRISE_CLI] - Steplib (%s) step (id:%s) (version:%s) found, activating step", stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version)
if err := bitrise.StepmanSetup(stepIDData.SteplibSource); err != nil {
registerStepRunResults("", models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
stepInfo, err := bitrise.StepmanStepInfo(stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version)
if err != nil {
if buildRunResults.IsStepLibUpdated(stepIDData.SteplibSource) {
registerStepRunResults("", models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
// May StepLib should be updated
log.Info("Step info not found in StepLib (%s) -- Updating ...")
if err := bitrise.StepmanUpdate(stepIDData.SteplibSource); err != nil {
registerStepRunResults("", models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
buildRunResults.StepmanUpdates[stepIDData.SteplibSource]++
stepInfo, err = bitrise.StepmanStepInfo(stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version)
if err != nil {
registerStepRunResults("", models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
}
stepInfoPtr.Version = stepInfo.Version
stepInfoPtr.Latest = stepInfo.Latest
if err := bitrise.StepmanActivate(stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version, stepDir, stepYMLPth); err != nil {
registerStepRunResults("", models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
} else {
log.Debugf("[BITRISE_CLI] - Step activated: (ID:%s) (version:%s)", stepIDData.IDorURI, stepIDData.Version)
}
} else {
registerStepRunResults("", models.StepRunStatusCodeFailed, 1, fmt.Errorf("Invalid stepIDData: No SteplibSource or LocalPath defined (%v)", stepIDData), isLastStep)
continue
}
// Fill step info with default step info, if exist
示例2: activateAndRunSteps
//.........这里部分代码省略.........
continue
}
if err := cmdex.CopyFile(filepath.Join(stepDir, "step.yml"), stepYMLPth); err != nil {
registerStepRunResults(stepmanModels.StepModel{}, stepInfoPtr, stepIdxPtr,
"", models.StepRunStatusCodeFailed, 1, err, isLastStep, true)
continue
}
} else if stepIDData.SteplibSource == "_" {
log.Debugf("[BITRISE_CLI] - Steplib independent step, with direct git uri: (uri:%s) (tag-or-branch:%s)", stepIDData.IDorURI, stepIDData.Version)
// Steplib independent steps are completly defined in workflow
stepYMLPth = ""
if err := workflowStep.FillMissingDefaults(); err != nil {
registerStepRunResults(stepmanModels.StepModel{}, stepInfoPtr, stepIdxPtr,
"", models.StepRunStatusCodeFailed, 1, err, isLastStep, true)
continue
}
if err := cmdex.GitCloneTagOrBranch(stepIDData.IDorURI, stepDir, stepIDData.Version); err != nil {
registerStepRunResults(stepmanModels.StepModel{}, stepInfoPtr, stepIdxPtr,
"", models.StepRunStatusCodeFailed, 1, err, isLastStep, true)
continue
}
} else if stepIDData.SteplibSource != "" {
log.Debugf("[BITRISE_CLI] - Steplib (%s) step (id:%s) (version:%s) found, activating step", stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version)
if err := tools.StepmanSetup(stepIDData.SteplibSource); err != nil {
registerStepRunResults(stepmanModels.StepModel{}, stepInfoPtr, stepIdxPtr,
"", models.StepRunStatusCodeFailed, 1, err, isLastStep, true)
continue
}
isLatestVersionOfStep := (stepIDData.Version == "")
if isLatestVersionOfStep && !buildRunResults.IsStepLibUpdated(stepIDData.SteplibSource) {
log.Infof("Step uses latest version -- Updating StepLib ...")
if err := tools.StepmanUpdate(stepIDData.SteplibSource); err != nil {
log.Warnf("Step uses latest version, but failed to update StepLib, err: %s", err)
} else {
buildRunResults.StepmanUpdates[stepIDData.SteplibSource]++
}
}
outStr, err := tools.StepmanJSONStepLibStepInfo(stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version)
if err != nil {
if buildRunResults.IsStepLibUpdated(stepIDData.SteplibSource) {
registerStepRunResults(stepmanModels.StepModel{}, stepInfoPtr, stepIdxPtr,
"", models.StepRunStatusCodeFailed, 1, fmt.Errorf("StepmanJSONStepLibStepInfo failed, err: %s", err), isLastStep, true)
continue
}
// May StepLib should be updated
log.Infof("Step info not found in StepLib (%s) -- Updating ...", stepIDData.SteplibSource)
if err := tools.StepmanUpdate(stepIDData.SteplibSource); err != nil {
registerStepRunResults(stepmanModels.StepModel{}, stepInfoPtr, stepIdxPtr,
"", models.StepRunStatusCodeFailed, 1, err, isLastStep, true)
continue
}
buildRunResults.StepmanUpdates[stepIDData.SteplibSource]++
outStr, err = tools.StepmanJSONStepLibStepInfo(stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version)
if err != nil {
registerStepRunResults(stepmanModels.StepModel{}, stepInfoPtr, stepIdxPtr,
"", models.StepRunStatusCodeFailed, 1, fmt.Errorf("StepmanJSONStepLibStepInfo failed, err: %s", err), isLastStep, true)
continue
}
}
示例3: activateAndRunSteps
//.........这里部分代码省略.........
}
} else if stepIDData.SteplibSource == "_" {
log.Debugf("[BITRISE_CLI] - Steplib independent step, with direct git uri: (uri:%s) (tag-or-branch:%s)", stepIDData.IDorURI, stepIDData.Version)
// Steplib independent steps are completly defined in workflow
stepYMLPth = ""
if err := workflowStep.FillMissingDefaults(); err != nil {
registerStepListItemRunResults(stepListItm, models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
if err := cmdex.GitCloneTagOrBranch(stepIDData.IDorURI, stepDir, stepIDData.Version); err != nil {
registerStepListItemRunResults(stepListItm, models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
stepVersionForInfoPrint = "_"
if stepIDData.Version != "" {
if len(stepIDData.Version) > 20 {
stepVersionForInfoPrint = stepVersionForInfoPrint + "@..." + stringutil.MaxLastChars(stepIDData.Version, 17)
} else {
stepVersionForInfoPrint = stepVersionForInfoPrint + "@" + stepIDData.Version
}
}
} else if stepIDData.SteplibSource != "" {
log.Debugf("[BITRISE_CLI] - Steplib (%s) step (id:%s) (version:%s) found, activating step", stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version)
if err := bitrise.StepmanSetup(stepIDData.SteplibSource); err != nil {
registerStepListItemRunResults(stepListItm, models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
stepInfo, err := bitrise.StepmanStepInfo(stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version)
if err != nil {
if buildRunResults.IsStepLibUpdated(stepIDData.SteplibSource) {
registerStepListItemRunResults(stepListItm, models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
// May StepLib should be updated
log.Info("Step info not found in StepLib (%s) -- Updating ...")
if err := bitrise.StepmanUpdate(stepIDData.SteplibSource); err != nil {
registerStepListItemRunResults(stepListItm, models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
buildRunResults.StepmanUpdates[stepIDData.SteplibSource]++
stepInfo, err = bitrise.StepmanStepInfo(stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version)
if err != nil {
registerStepListItemRunResults(stepListItm, models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
}
}
stepVersionForInfoPrint = stepInfo.StepVersion
if err := bitrise.StepmanActivate(stepIDData.SteplibSource, stepIDData.IDorURI, stepIDData.Version, stepDir, stepYMLPth); err != nil {
registerStepListItemRunResults(stepListItm, models.StepRunStatusCodeFailed, 1, err, isLastStep)
continue
} else {
log.Debugf("[BITRISE_CLI] - Step activated: (ID:%s) (version:%s)", stepIDData.IDorURI, stepIDData.Version)
}
} else {
registerStepListItemRunResults(stepListItm, models.StepRunStatusCodeFailed, 1, fmt.Errorf("Invalid stepIDData: No SteplibSource or LocalPath defined (%v)", stepIDData), isLastStep)
continue
}
mergedStep := workflowStep
if stepYMLPth != "" {