Compare commits

...

5 Commits

Author SHA1 Message Date
Evan Hazlett
e2c88d6dac bump v0.4.1
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-08-14 11:11:20 -04:00
Evan Hazlett
4b83428696 remove sudo -E for provisioning
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-08-14 10:11:05 -04:00
Evan Hazlett
a2b2e069eb debian/ubuntu: do not upgrade the system for a single package
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-08-14 10:11:00 -04:00
Evan Hazlett
b3b42d069d fixes upgrade for debian/ubuntu for new package name
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-08-14 10:10:52 -04:00
Evan Hazlett
9d0dc7a652 bump 0.4.0
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-08-10 15:20:12 -04:00
3 changed files with 56 additions and 17 deletions

View File

@@ -59,18 +59,16 @@ func (provisioner *DebianProvisioner) Package(name string, action pkgaction.Pack
updateMetadata := true
switch action {
case pkgaction.Install:
case pkgaction.Install, pkgaction.Upgrade:
packageAction = "install"
case pkgaction.Remove:
packageAction = "remove"
updateMetadata = false
case pkgaction.Upgrade:
packageAction = "upgrade"
}
switch name {
case "docker":
name = "lxc-docker"
name = "docker-engine"
}
if updateMetadata {
@@ -79,6 +77,28 @@ func (provisioner *DebianProvisioner) Package(name string, action pkgaction.Pack
}
}
// handle the new docker-engine package; we can probably remove this
// after we have a few versions
if action == pkgaction.Upgrade && name == "docker-engine" {
// run the force remove on the existing lxc-docker package
// and remove the existing apt source list
// also re-run the get.docker.com script to properly setup
// the system again
commands := []string{
"rm /etc/apt/sources.list.d/docker.list || true",
"apt-get remove -y lxc-docker || true",
"curl -sSL https://get.docker.com | sh",
}
for _, cmd := range commands {
command := fmt.Sprintf("sudo DEBIAN_FRONTEND=noninteractive %s", cmd)
if _, err := provisioner.SSHCommand(command); err != nil {
return err
}
}
}
command := fmt.Sprintf("DEBIAN_FRONTEND=noninteractive sudo -E apt-get %s -y %s", packageAction, name)
log.Debugf("package: action=%s name=%s", action.String(), name)

View File

@@ -47,36 +47,55 @@ func (provisioner *UbuntuProvisioner) Service(name string, action pkgaction.Serv
}
func (provisioner *UbuntuProvisioner) Package(name string, action pkgaction.PackageAction) error {
var (
packageAction string
updateMetadata = true
)
var packageAction string
updateMetadata := true
switch action {
case pkgaction.Install:
case pkgaction.Install, pkgaction.Upgrade:
packageAction = "install"
case pkgaction.Remove:
packageAction = "remove"
updateMetadata = false
case pkgaction.Upgrade:
packageAction = "upgrade"
}
// TODO: This should probably have a const
switch name {
case "docker":
name = "lxc-docker"
name = "docker-engine"
}
if updateMetadata {
// issue apt-get update for metadata
if _, err := provisioner.SSHCommand("sudo -E apt-get update"); err != nil {
if _, err := provisioner.SSHCommand("sudo apt-get update"); err != nil {
return err
}
}
// handle the new docker-engine package; we can probably remove this
// after we have a few versions
if action == pkgaction.Upgrade && name == "docker-engine" {
// run the force remove on the existing lxc-docker package
// and remove the existing apt source list
// also re-run the get.docker.com script to properly setup
// the system again
commands := []string{
"rm /etc/apt/sources.list.d/docker.list || true",
"apt-get remove -y lxc-docker || true",
"curl -sSL https://get.docker.com | sh",
}
for _, cmd := range commands {
command := fmt.Sprintf("sudo DEBIAN_FRONTEND=noninteractive %s", cmd)
if _, err := provisioner.SSHCommand(command); err != nil {
return err
}
}
}
command := fmt.Sprintf("DEBIAN_FRONTEND=noninteractive sudo -E apt-get %s -y %s", packageAction, name)
log.Debugf("package: action=%s name=%s", action.String(), name)
if _, err := provisioner.SSHCommand(command); err != nil {
return err
}

View File

@@ -6,8 +6,8 @@ var (
// therefore migration, introduced to the config file format.
ConfigVersion = 1
// Version should be updated by hand at each release
Version = "0.4.0-dev"
// VERSION should be updated by hand at each release
Version = "0.4.1"
// GitCommit will be overwritten automatically by the build system
GitCommit = "HEAD"