本文整理汇总了Golang中github.com/concourse/atc/db.PipelineDB.Pause方法的典型用法代码示例。如果您正苦于以下问题:Golang PipelineDB.Pause方法的具体用法?Golang PipelineDB.Pause怎么用?Golang PipelineDB.Pause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/concourse/atc/db.PipelineDB
的用法示例。
在下文中一共展示了PipelineDB.Pause方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: PausePipeline
func (s *Server) PausePipeline(pipelineDB db.PipelineDB) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
err := pipelineDB.Pause()
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusOK)
})
}
示例2: PausePipeline
func (s *Server) PausePipeline(pipelineDB db.PipelineDB) http.Handler {
logger := s.logger.Session("pause-pipeline")
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
err := pipelineDB.Pause()
if err != nil {
logger.Error("failed-to-pause-pipeline", err)
w.WriteHeader(http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusOK)
})
}
示例3:
Expect(page.Navigate(homepage())).To(Succeed())
Eventually(page.Find(".job.paused")).Should(BeFound())
// job-detail unpausing
Expect(page.Navigate(withPath("/jobs/job-name"))).To(Succeed())
Eventually(page.Find("#job-state.btn-pause")).Should(BeFound())
Expect(page.Find("#job-state.btn-pause").Click()).To(Succeed())
Eventually(page.Find("#job-state.btn-pause.disabled")).Should(BeFound())
Eventually(page.Find("#job-state.btn-pause.enabled")).ShouldNot(BeFound())
})
Describe("paused pipeline", func() {
BeforeEach(func() {
pipelineDB, err := pipelineDBFactory.BuildWithTeamNameAndName(atc.DefaultTeamName, atc.DefaultPipelineName)
Expect(err).NotTo(HaveOccurred())
err = pipelineDB.Pause()
Expect(err).NotTo(HaveOccurred())
})
It("displays a blue header", func() {
// homepage -> job detail w/build info
Expect(page.Navigate(homepage())).To(Succeed())
// we will need to authenticate later to prove it is working for our page
Authenticate(page, "admin", "password")
Expect(page.Navigate(withPath("jobs/job-name"))).To(Succeed())
// top bar should show the pipeline is paused
Eventually(page.Find(".js-groups.paused")).Should(BeFound())
})
})