bazooka-ci / bazooka

Continuous Integration and Continuous Deployment Server
http://docs.bazooka-ci.io/
MIT License
60 stars 5 forks source link

Improve `bzk run --update` usage #170

Closed julienvey closed 9 years ago

julienvey commented 9 years ago

Currently, the code when running update is

log.Printf("Pulling Bazooka images to check for new versions\n")
  mandatoryImages := []string{"server", "web", "orchestration", "parser"}
  optionalImages := []string{"parser-java", "parser-golang", "scm-git",  "runner-java", "runner-java:oraclejdk8", "runner-java:oraclejdk7", "runner-java:oraclejdk6", "runner java:openjdk8", "runner java:openjdk7", "runner-java:openjdk6", "runner-golang", "runner-golang:1.2.2", "runner-golang:1.3", "runner-golang:1.3.1", "runner-golang:1.3.2", "runner-golang:1.3.3", "runner-golang:1.4"}
  for _, image := range mandatoryImages {
    err = client.Pull(&docker.PullOptions{Image: getImageLocation(*registry, fmt.Sprintf("bazooka/%s", image))})
    if err != nil {
      log.Fatal(fmt.Errorf("Unable to pull required image for Bazooka, reason is: %v\n", err))
    }
  }
  for _, image := range optionalImages {
    err = client.Pull(&docker.PullOptions{Image: getImageLocation(*registry, fmt.Sprintf("bazooka/%s", image))})
      if err != nil {
        log.Printf("Unable to pull image for Bazooka, as it is an optional one, let's move on. Reason is: %v\n", err)
      }
    }

It tries to docker pull all mandatory images and optional images, even if these images where never downloaded

What I propose is:

This way, it will only docker pull images that were already present on the system

julienvey commented 9 years ago

Could be done with #173