Return-Path: X-Original-To: apmail-jmeter-dev-archive@minotaur.apache.org Delivered-To: apmail-jmeter-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 55A72191CF for ; Tue, 5 Apr 2016 15:33:45 +0000 (UTC) Received: (qmail 4881 invoked by uid 500); 5 Apr 2016 15:33:45 -0000 Delivered-To: apmail-jmeter-dev-archive@jmeter.apache.org Received: (qmail 4847 invoked by uid 500); 5 Apr 2016 15:33:45 -0000 Mailing-List: contact dev-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list dev@jmeter.apache.org Received: (qmail 4836 invoked by uid 99); 5 Apr 2016 15:33:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2016 15:33:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 8085BC0227 for ; Tue, 5 Apr 2016 15:33:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.278 X-Spam-Level: * X-Spam-Status: No, score=1.278 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id RD7eprP3joES for ; Tue, 5 Apr 2016 15:33:42 +0000 (UTC) Received: from BLU004-OMC4S18.hotmail.com (blu004-omc4s18.hotmail.com [65.55.111.157]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 62DB75F1B3 for ; Tue, 5 Apr 2016 15:33:42 +0000 (UTC) Received: from BLU436-SMTP227 ([65.55.111.137]) by BLU004-OMC4S18.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Tue, 5 Apr 2016 08:33:36 -0700 X-TMN: [CHiaGjWsx1vinxrYPXYIBDTb/jbRBh0q] X-Originating-Email: [oliver_lloyd@hotmail.com] Message-ID: From: Oliver Lloyd Content-Type: multipart/alternative; boundary="Apple-Mail=_BEDC87EC-4223-434E-80CD-15149CD9F5CC" MIME-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: Best location to download jmeter from using an unattended script? Date: Tue, 5 Apr 2016 16:33:28 +0100 References: <2C8E2779-C7E0-4E56-9E3E-6A20FCB77E50@internetallee.de> To: dev@jmeter.apache.org In-Reply-To: <2C8E2779-C7E0-4E56-9E3E-6A20FCB77E50@internetallee.de> X-Mailer: Apple Mail (2.2104) X-OriginalArrivalTime: 05 Apr 2016 15:33:33.0066 (UTC) FILETIME=[832216A0:01D18F50] --Apple-Mail=_BEDC87EC-4223-434E-80CD-15149CD9F5CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" In the end I wrote a function. It solved the closer.cgi issue I was = having by using the as_json=3D1 query param that Vladimir suggested. #!/bin/bash function install_jmeter() { # ------------------------------------------------ # Decide where to download jmeter from # # Order of preference: # 1. Mirror, if the desired version is current # 2. S3, if not current and we have a copy # 3. Archive, as a backup # ------------------------------------------------ # Mirrors only host the current version, get the preferred mirror = for this location preferred_mirror=3D$(curl -s = 'http://www.apache.org/dyn/closer.cgi?as_json=3D1' | grep "preferred" | = cut -d ':' -f3 | cut -d'"' -f1 | awk -F// '{print $NF}' | sed 's/.$//') # Scrape the main binaries page to see what the current version is current=3D$(curl -s 'http://www.apache.org/dist/jmeter/binaries/') if [ $(echo $current | grep -c "$JMETER_VERSION") -gt "0" ] ; then # This is the current version of jmeter so use the preferred = mirror to download echo "downloading from preferred mirror: = http://$preferred_mirror/jmeter/binaries/$JMETER_VERSION.tgz" wget -q -O $REMOTE_HOME/$JMETER_VERSION.tgz = http://$preferred_mirror/jmeter/binaries/$JMETER_VERSION.tgz elif [ $(curl -sI = https://s3.amazonaws.com/jmeter-ec2/$JMETER_VERSION.tgz | grep -c "403 = Forbidden") -eq "0" ] ; then # It wasn't the current version but we have a copy on S3 so use = that echo "Downloading jmeter from S3" wget -q -O $REMOTE_HOME/$JMETER_VERSION.tgz = https://s3.amazonaws.com/jmeter-ec2/$JMETER_VERSION.tgz else # Fall back to the archive server echo "Downloading jmeter from Apache Archive" wget -q -O $REMOTE_HOME/$JMETER_VERSION.tgz = http://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz fi # Untar downloaded file tar -xf $REMOTE_HOME/$JMETER_VERSION.tgz } JMETER_VERSION=3D"apache-jmeter-2.13" REMOTE_HOME=3D"/tmp" install_jmeter > On 5 Apr 2016, at 13:21, Felix Schumacher = wrote: >=20 >=20 >=20 > Am 4. April 2016 14:29:13 MESZ, schrieb Oliver Lloyd = : >> That url is in theory exactly what I need and it works well in a >> browser but I'm not able to make it work from the CLI using something >> like wget or curl. Does anyone know how to make that cgi script serve >> me the file and not just the html for the download page? >=20 > Have you tried "curl -L 'http://..."? >=20 > Regards,=20 > Felix=20 >=20 >>=20 >>=20 >>> On 3 Apr 2016, at 22:48, sebb wrote: >>>=20 >>> On 3 April 2016 at 20:46, Oliver Lloyd >> wrote: >>>> Bintray sounds ideal. Speeds between dl.bintray.com and AWS are = very >> fast. >>>>=20 >>>> My issue is I can't really use a mirror because they change but >> linking to the host servers is bad because they're not designed to >> serve these files. A distribution as a service provider like bintray >> would definitely solve this problem. >>>=20 >>> Why not? >>>=20 >>> It's possible to use the automatic mirror chooser with a parameter >>> that automatically downloads: >>>=20 >>>=20 >> = http://www.apache.org/dyn/closer.cgi?filename=3Djmeter/binaries/apache-jme= ter-2.13.zip&action=3Ddownload >>>=20 >>>> In the meantime I'm experimenting with using 'www.apache.org/dist/ >> ...' vs. 'archive.apache.org/dist/ >> ...' and this seems better. >>>=20 >>> Neither of those should be used for normal downloads. >>> They are for last resort backup purposes / archived releases only. >>>=20 >>>>=20 >>>>> On 3 Apr 2016, at 20:31, Vladimir Sitnikov >> wrote: >>>>>=20 >>>>> What if we deployed binary artifacts to maven, then they would get >>>>> mirrored to bintray? >>>>>=20 >>>>> Groovy is using bintray.com for distribution of their binaries: >>>>> http://groovy-lang.org/download.html links to >>>>> https://dl.bintray.com/groovy/maven/apache-groovy-sdk-2.4.6.zip >>>>>=20 >>>>> Oliver, >>>>> Can I kindly ask you to download something like >>>>> https://dl.bintray.com/groovy/maven/apache-groovy-sdk-2.4.6.zip >>>>> to check if that will be good enough? >>>>>=20 >>>>> Vladimir >>>>>=20 >>>>=20 >>>=20 >=20 >=20 --Apple-Mail=_BEDC87EC-4223-434E-80CD-15149CD9F5CC--