Skip to content

Commit

Permalink
fix: use proxy for wget (#78)
Browse files Browse the repository at this point in the history
* fix: use proxy for wget
* chore: disable self-hosted runner for tests
  • Loading branch information
yanksyoon authored Jul 5, 2023
1 parent ccb1a9c commit 015bd5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Tests

on:
pull_request: { }
pull_request: {}

jobs:
unit-tests:
uses: canonical/operator-workflows/.github/workflows/test.yaml@main
secrets: inherit
with:
self-hosted-runner: false
11 changes: 10 additions & 1 deletion src/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,5 +635,14 @@ def _wget_install(self, executables: Iterable[WgetExecutable]) -> None:
for executable in executables:
executable_path = f"/usr/bin/{executable.cmd}"
logger.info("Downloading %s via wget to %s...", executable.url, executable_path)
self.instance.execute(["/usr/bin/wget", executable.url, "-O", executable_path])
wget_cmd = ["/usr/bin/wget", executable.url, "-O", executable_path]
if self.config.proxies.get("http", None) or self.config.proxies.get("https", None):
wget_cmd += ["-e", "use_proxy=on"]
if self.config.proxies.get("http", None):
wget_cmd += ["-e", f"http_proxy={self.config.proxies['http']}"]
if self.config.proxies.get("https", None):
wget_cmd += ["-e", f"https_proxy={self.config.proxies['https']}"]
if self.config.proxies.get("no_proxy", None):
wget_cmd += ["-e", f"no_proxy={self.config.proxies['no_proxy']}"]
self.instance.execute(wget_cmd)
self.instance.execute(["/usr/bin/chmod", "+x", executable_path])

0 comments on commit 015bd5e

Please sign in to comment.