This is an automated email from the ASF dual-hosted git repository.

aw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/master by this push:
     new dd436f0  YETUS-866. add a simple yetus binary tarball script
dd436f0 is described below

commit dd436f0491d6d2de52c8aa7db7005edd0e9e2491
Author: Allen Wittenauer <a...@apache.org>
AuthorDate: Sun Apr 28 23:02:38 2019 -0700

    YETUS-866. add a simple yetus binary tarball script
    
    Signed-off-by: Allen Wittenauer <a...@apache.org>
---
 asf-site-src/config.rb                     |  7 ++++
 asf-site-src/data/htaccess.yml             | 20 ++++++++++
 asf-site-src/source/.htaccess.apache.erb   | 21 ++++++++++
 asf-site-src/source/contribute/releases.md |  2 +
 asf-site-src/source/downloads.html.md.erb  | 17 +++++++-
 yetus-dl.sh                                | 64 ++++++++++++++++++++++++++++++
 6 files changed, 129 insertions(+), 2 deletions(-)

diff --git a/asf-site-src/config.rb b/asf-site-src/config.rb
index 509c9ff..5599344 100644
--- a/asf-site-src/config.rb
+++ b/asf-site-src/config.rb
@@ -44,6 +44,9 @@ activate :directory_indexes
 activate :syntax
 activate :livereload
 
+# disable layout
+page '.htaccess.apache', :layout => false # rubocop:disable Style/HashSyntax
+
 # classes needed to publish our api docs
 class CopyInPlaceResource < ::Middleman::Sitemap::Resource
   def initialize(sitemap, dest, src)
@@ -219,3 +222,7 @@ after_configuration do # rubocop:disable Metrics/BlockLength
     end
   end
 end
+
+after_build do
+  File.rename 'target/site/.htaccess.apache', 'target/site/.htaccess'
+end
diff --git a/asf-site-src/data/htaccess.yml b/asf-site-src/data/htaccess.yml
new file mode 100644
index 0000000..990c7a2
--- /dev/null
+++ b/asf-site-src/data/htaccess.yml
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+---
+redirect:
+  /latest.tgz: >
+    
https://www.apache.org/dyn/closer.cgi?action=download&filename=yetus/0.10.0/apache-yetus-0.10.0-bin.tar.gz
+  /latest.tgz.asc: >
+    https://www.apache.org/dist/yetus/0.10.0/apache-yetus-0.10.0-bin.tar.gz.asc
diff --git a/asf-site-src/source/.htaccess.apache.erb 
b/asf-site-src/source/.htaccess.apache.erb
new file mode 100644
index 0000000..1c1e314
--- /dev/null
+++ b/asf-site-src/source/.htaccess.apache.erb
@@ -0,0 +1,21 @@
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+<% data.htaccess.redirect.each do |old, new| %>
+Redirect 307 <%= old %> <%= new %>
+<% end %>
diff --git a/asf-site-src/source/contribute/releases.md 
b/asf-site-src/source/contribute/releases.md
index d5e218e..b5f1ed8 100644
--- a/asf-site-src/source/contribute/releases.md
+++ b/asf-site-src/source/contribute/releases.md
@@ -571,6 +571,7 @@ Once a release candidate obtains majority approval from the 
PMC, there are sever
    $ cd asf-site-src
    $ # Add the release to the releases data file
    $ vim data/versions.yml
+   $ vim data/htaccess.yml
    $ vim pom.xml
    $ # add the two stanzas
    $ git add -p
@@ -589,6 +590,7 @@ Once a release candidate obtains majority approval from the 
PMC, there are sever
 
 1. You should then post this patch for review. Once you've gotten feedback, 
it's fine to push the patch to the ASF source repo immediately so long as the 
updated website is not published.
 1. Publish website updates. After the 24 hour window needed for the release 
artifacts to make their way to the variety of mirrors, you should render the 
website and publish it using the instructions found in [Maintaining the Yetus 
Website](../website).
+1. Verify that https://yetus.apache.org/latest.tgz and 
https://yetus.apache.org/latest.tgz.asc download the newly released version.
 1. Remove old releases from the distribution area. The ASF distribution area 
should only contain the most recent release for actively developed branches If 
your release is a maintenance release, delete the prior release. If your 
release marks the end of maintenance for an earlier minor or major release 
line, you should delete those versions from the distribution area.
 1. Draft an announcement email. The announcement email should briefly describe 
our project and provide links to our artifacts and documentation. For example,
         Subject: [ANNOUNCE] Apache Yetus 0.7.0 release
diff --git a/asf-site-src/source/downloads.html.md.erb 
b/asf-site-src/source/downloads.html.md.erb
index a99bcc2..daa120a 100644
--- a/asf-site-src/source/downloads.html.md.erb
+++ b/asf-site-src/source/downloads.html.md.erb
@@ -49,10 +49,23 @@ third-party repositories (e.g. Maven Central) and [Docker 
Hub](../yetus-docker-i
 <%   end
    end %>
 
+## OS X Homebrew/Linuxbrew
+
 The latest version of Apache Yetus is also available via Homebrew on Mac OS X:
-```shell
+
+```bash
 brew tap apache/yetus https://github.com/apache/yetus
 brew install yetus
 ```
 
-This will install many of the dependencies needed for the precommit 
functionality as well.
\ No newline at end of file
+This will install many of the dependencies needed for the precommit 
functionality as well.
+
+## Helper Script
+
+To aid in downloading Apache Yetus for continuous integration systems, local 
build environments, etc, we provide a simple script that may be checked into 
your local repo [here](https://github.com/apache/yetus/yetus-dl.sh). It takes 
two parameters:
+
+```bash
+$ yetus-dl.sh <location> <version>
+```
+
+By default, location is `/tmp/yetus` and the version is the latest version. 
Compatibility is not guaranteed between 'latest' versions.  Additionally, only 
the last three released versions will be available via this method.
\ No newline at end of file
diff --git a/yetus-dl.sh b/yetus-dl.sh
new file mode 100755
index 0000000..a37144d
--- /dev/null
+++ b/yetus-dl.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+EXTRACTDIR="${1:-/tmp/yetus}"
+VERSION=${2:-latest}
+KEYSURL="https://www.apache.org/dist/yetus/KEYS";
+if [ "${VERSION}" != "latest" ]; then
+  
BASEURL="https://www.apache.org/dyn/closer.cgi?action=download&filename=yetus/${VERSION}";
+  YETUSTGZ="apache-yetus-${VERSION}-bin.tar.gz"
+else
+  BASEURL="https://yetus.apache.org";
+  YETUSTGZ="latest.tgz"
+fi
+
+if [ ! -d "${EXTRACTDIR}" ]; then
+  if ! mkdir -p "${EXTRACTDIR}"; then
+    echo "ERROR: yetus-dl: unable to create ${EXTRACTDIR}"
+    exit 1
+  fi
+fi
+
+if ! curl -f -s -L -o "${EXTRACTDIR}/KEYS" "${KEYSURL}"; then
+  echo "ERROR: yetus-dl: unable to fetch ${KEYSURL}"
+  exit 1
+fi
+
+if ! curl -f -s -L -o "${EXTRACTDIR}/${YETUSTGZ}.asc" 
"${BASEURL}/${YETUSTGZ}.asc"; then
+  echo "ERROR: yetus-dl: unable to fetch ${BASEURL}/${YETUSTGZ}.asc"
+  exit 1
+fi
+
+if ! curl -f -s -L -o "${EXTRACTDIR}/${YETUSTGZ}" "${BASEURL}/${YETUSTGZ}"; 
then
+  echo "ERROR: yetus-dl: unable to fetch ${BASEURL}/${YETUSTGZ}.asc"
+  exit 1
+fi
+
+if ! gpg --import "${EXTRACTDIR}/KEYS" >/dev/null 2>&1; then
+  echo "ERROR: yetus-dl: gpg unable to import ${EXTRACTDIR}/KEYS"
+  exit 1
+fi
+
+if ! gpg --verify "${EXTRACTDIR}/${YETUSTGZ}.asc" >/dev/null 2>&1; then
+ echo "ERROR: yetus-dl: gpg verify of tarball in ${EXTRACTDIR} failed"
+ exit 1
+fi
+
+if ! tar -C "${EXTRACTDIR}" --strip-components=1 -xzpf 
"${EXTRACTDIR}/${YETUSTGZ}"; then
+  echo "ERROR: ${YETUSTGZ} is corrupt. Investigate and then remove 
${EXTRACTDIR} to try again."
+  exit 1
+fi

Reply via email to