本文整理匯總了Golang中github.com/flynn/flynn/controller/types.Release.IsGitDeploy方法的典型用法代碼示例。如果您正苦於以下問題:Golang Release.IsGitDeploy方法的具體用法?Golang Release.IsGitDeploy怎麽用?Golang Release.IsGitDeploy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/flynn/flynn/controller/types.Release
的用法示例。
在下文中一共展示了Release.IsGitDeploy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: runImport
//.........這裏部分代碼省略.........
}
if bar != nil {
config.Stdin = bar.NewProxyReader(config.Stdin)
}
if err := runJob(client, config); err != nil {
return fmt.Errorf("error uploading layer: %s", err)
}
return nil
}
release.ArtifactIDs = make([]string, len(artifacts))
for i, artifact := range artifacts {
if artifact.Type != ct.ArtifactTypeFlynn {
continue
}
if !artifact.Blobstore() {
continue
}
for _, rootfs := range artifact.Manifest().Rootfs {
for _, layer := range rootfs.Layers {
if err := upload(layer.ID, artifact.LayerURL(layer)); err != nil {
return err
}
}
}
artifact.ID = ""
if err := client.CreateArtifact(artifact); err != nil {
return fmt.Errorf("error creating artifact: %s", err)
}
release.ArtifactIDs[i] = artifact.ID
}
// use the current slugrunner image for slug releases
if release.IsGitDeploy() {
gitreceiveRelease, err := client.GetAppRelease("gitreceive")
if err != nil {
return fmt.Errorf("unable to retrieve gitreceive release: %s", err)
}
slugRunnerID, ok := gitreceiveRelease.Env["SLUGRUNNER_IMAGE_ID"]
if !ok {
return fmt.Errorf("gitreceive env missing slugrunner image")
}
release.ArtifactIDs[0] = slugRunnerID
}
}
if release != nil {
for t, proc := range release.Processes {
// update legacy slug releases to use Args rather than the
// deprecated Entrypoint and Cmd fields
if release.IsGitDeploy() && len(proc.Args) == 0 {
proc.Args = append([]string{"/runner/init"}, proc.DeprecatedCmd...)
proc.DeprecatedCmd = nil
}
for i, port := range proc.Ports {
if port.Service != nil && strings.HasPrefix(port.Service.Name, oldName) {
proc.Ports[i].Service.Name = strings.Replace(port.Service.Name, oldName, app.Name, 1)
}
}
release.Processes[t] = proc
}
if err := client.CreateRelease(release); err != nil {
return fmt.Errorf("error creating release: %s", err)
}
if err := client.SetAppRelease(app.ID, release.ID); err != nil {
return fmt.Errorf("error setting app release: %s", err)