Пример #1
0
func prepareStagingFilesystem(cloudfockerHome string) {
	if err := utils.CreateAndCleanAppDirs(cloudfockerHome); err != nil {
		log.Fatalf(" %s", err)
	}
	if err := buildpack.AtLeastOneBuildpackIn(cloudfockerHome + "/buildpacks"); err != nil {
		log.Fatalf(" %s", err)
	}
	if err := utils.CopyFockerBinaryToOwnDir(cloudfockerHome); err != nil {
		log.Fatalf(" %s", err)
	}
}
Пример #2
0
		Context("without buildpacks", func() {
			It("should say there are no buildpacks installed", func() {
				buildpackDir, _ := ioutil.TempDir(os.TempDir(), "cfocker-buildpack-list-test")
				err := buildpack.List(buffer, buildpackDir)
				Expect(err).ShouldNot(HaveOccurred())
				Eventually(buffer).Should(gbytes.Say(`No buildpacks installed`))
				os.RemoveAll(buildpackDir)
			})
		})
	})
	Describe("Checking for the presence of at least one buildpack", func() {
		Context("with one buildpack", func() {
			It("should return without error", func() {
				buildpackDir, _ := ioutil.TempDir(os.TempDir(), "cfocker-buildpack-test-buildpack")
				os.Mkdir(buildpackDir+"/testbuildpack", 0755)
				err := buildpack.AtLeastOneBuildpackIn(buildpackDir)
				Expect(err).ShouldNot(HaveOccurred())
				os.RemoveAll(buildpackDir)
			})
		})
		Context("with no buildpacks", func() {
			It("should return an error", func() {
				buildpackDir, _ := ioutil.TempDir(os.TempDir(), "cfocker-buildpack-test-buildpack")
				err := buildpack.AtLeastOneBuildpackIn(buildpackDir)
				Expect(err).Should(HaveOccurred())
				os.RemoveAll(buildpackDir)
			})
		})
	})
})