Exemple #1
0
func init() {
	cfg := data.GetConfig()

	var err error
	Proxy, err = newJenkinsProxy(cfg.JenkinsUrl, cfg.JenkinsUsername, cfg.JenkinsPassword)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Could not connect to Jenkins build server: %s\n", err.Error())
		fmt.Fprintf(os.Stderr, "Please check your connection and configuration settings\n")
		periodicallyRecheckConnection(cfg)
	}
}
Exemple #2
0
// remove me soon
func exampleCreate() {
	ports := make([]Port, 0, 1)
	ports = append(ports, Port{Private: 8080, Public: 8080, Type: "tcp"})

	vars := make(map[string]string)
	vars["env-var"] = "env-val"

	registry := data.GetConfig().Registry

	containerName := "bpc-core-service"
	img := registry + "/" + containerName
	fmt.Printf("Creating from img: %s\n", img)
	ctr, err := CreateContainer(containerName, img, "dev", ports, vars)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error creating container: %s\n", err.Error())
	}

	err = StartContainer(ctr.ID)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error starting container: %s\n", err.Error())
	}
}