Comment 3 for bug 1753340

Revision history for this message
Brett Sutton (bsutton) wrote : Re: [Bug 1753340] Re: build failing on download by ant build

I'm no Ant expert but it looks to me like the ant plugin is able to pick
up proxy settings from environment variables.

https://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/ant.py

I don't do python but :

   def get_proxy_options(self, scheme):
         proxy = os.environ.get('{}_proxy'.format(scheme))
         if proxy:
             parsed = urlsplit(proxy)
             if parsed.hostname is not None:
                 yield '-D{}.proxyHost={}'.format(scheme, parsed.hostname)
             if parsed.port is not None:
                 yield '-D{}.proxyPort={}'.format(scheme, parsed.port)
             if parsed.username is not None:
                 yield '-D{}.proxyUser={}'.format(scheme, parsed.username)
             if parsed.password is not None:
                 yield '-D{}.proxyPassword={}'.format(scheme,
parsed.password)

Which I read as looking for environment vars such as:

http(s)_proxyHost

http(s)_proxyPort

http(s)_proxyUser

http(s)_proxyPassword

Ant directly supports an 'autoproxy' option which I've tried (in the
IrrigationForPi app mentioned below)

https://ant.apache.org/manual/proxy.html

Ant also allows you to configure a properties file that contains args
and I think these can be configured to also pickup environment vars.

I believe you can also pass these type of args from the snapcraft ant
plugins ant-options key.

You will see in the IrrigationForPi snapcraft that I've tried this as well.

So I think I just need to know if the build servers provide environment
vars and their names  or what the settings should be.

My script is attached.

I have a second app which is public which has the same problem and which
is on the build servers so you can look at that one.

https://build.snapcraft.io/user/bsutton/IrrigationForPi-Snap

The code is available here:

https://github.com/bsutton/IrrigationForPi

Snapcraft here:

https://github.com/bsutton/IrrigationForPi/tree/master/snap-projects/installer/snap

its the 'tomcat' part that is causing the problem.

Brett

On 10/05/18 23:18, Adam Collard wrote:
> I'm unable to view the build on build.snapcraft.io - could you share the
> snapcraft.yaml that failed?
>
> The various Java build tools are very tricky to configure w.r.t.
> proxies, any insights you can share on how to get Ant to play nicely
> with an authenticated proxy would be welcome
>
> ** Changed in: launchpad-buildd
> Status: New => Incomplete
>