()
| 153 | } |
| 154 | |
| 155 | func installAptProxy() error { |
| 156 | proxy := os.Getenv("http_proxy") |
| 157 | if proxy == "" { |
| 158 | log.Println("http_proxy is not set, skipping apt proxy configuration") |
| 159 | return nil |
| 160 | } |
| 161 | |
| 162 | const confPath = "/etc/apt/apt.conf.d/99proxy" |
| 163 | if _, err := os.Stat(confPath); err == nil { |
| 164 | log.Printf("apt proxy config already exists at %s, skipping", confPath) |
| 165 | return nil |
| 166 | } |
| 167 | |
| 168 | log.Printf("configuring apt proxy to use %s", proxy) |
| 169 | proxyConf := fmt.Sprintf("Acquire::http::Proxy \"%s\";", proxy) |
| 170 | cmd := fmt.Sprintf("echo '%s' | sudo tee /etc/apt/apt.conf.d/99proxy", proxyConf) |
| 171 | return run("bash", "-c", cmd) |
| 172 | } |
| 173 | |
| 174 | func installPostgreSQL() error { |
| 175 | log.Println("--- Installing PostgreSQL ---") |
no test coverage detected
searching dependent graphs…