~cjwatson/launchpad-buildd/extended-snap-status

« back to all changes in this revision

Viewing changes to buildsnap

  • Committer: Colin Watson
  • Date: 2016-11-30 10:20:32 UTC
  • mfrom: (204.1.1 snap-proxy-allow-build)
  • Revision ID: cjwatson@canonical.com-20161130102032-mcq9q6qx5zmmkkm8
[r=wgrant] buildsnap: Grant access to the proxy during the build phase as well as during the pull phase (LP: #1642281).

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
    def build(self):
137
137
        """Run all build, stage and snap phases."""
138
138
        print("Running build phase...")
 
139
        env = {}
 
140
        if self.options.proxy_url:
 
141
            env["http_proxy"] = self.options.proxy_url
 
142
            env["https_proxy"] = self.options.proxy_url
139
143
        self.run_build_command(
140
 
            ["snapcraft"], path=os.path.join("/build", self.name))
 
144
            ["snapcraft"], path=os.path.join("/build", self.name), env=env)
141
145
 
142
146
    def revoke_token(self):
143
147
        """Revoke builder proxy token."""