From a7ef3a14684bb04aaf3009b5eb54c632c7a772ac Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 17 May 2021 09:01:17 +0200 Subject: [PATCH] Add script to copy apidocs and xref to netty-website Motivation: After the release was done we need to also copy the apidocs and xref to the netty-website Modifications: Add script that does the copy etc Result: Less manual steps to remember --- scripts/copy_javadocs.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 scripts/copy_javadocs.sh diff --git a/scripts/copy_javadocs.sh b/scripts/copy_javadocs.sh new file mode 100755 index 0000000000..e41576a5f1 --- /dev/null +++ b/scripts/copy_javadocs.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -e + +if [ "$#" -ne 1 ]; then + echo "Expected netty-website directory" + exit 1 +fi + +if [ ! -d "$1" ]; then + echo "$1 is not a directory" + exit 1 +fi + + +BRANCH=$(git branch --show-current) +WEBSITE_API_DIR="$1"/"$BRANCH"/api/ +WEBSITE_XREF_DIR="$1"/"$BRANCH"/xref/ +API_DIR=all/target/api/ +XREF_DIR=all/target/xref/ + +if [ ! -d "$API_DIR" ]; then + echo "$API_DIR not exists, didn't run the release process yet?" + exit 1 +fi + +if [ ! -d "$XREF_DIR" ]; then + echo "$XREF_DIR not exists, didn't run the release process yet?" + exit 1 +fi + +echo "Delete old javadocs and xref files" +rm -rf "$WEBSITE_API_DIR"/* +rm -rf "$WEBSITE_XREF_DIR"/* + +echo "Copy javadocs and xref files" +cp -r "$API_DIR"/* "$WEBSITE_API_DIR" +cp -r "$XREF_DIR"/* "$WEBSITE_XREF_DIR"