-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathprebuild.sh
34 lines (25 loc) · 1.22 KB
/
prebuild.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
CURRENT_VERSION=$(grep 'currentProjectVersion = ' config.toml | cut -d \" -f 2)
RESOURCES_DIR=resources
PREBUILD_DIR=prebuild
MAVEN_BASE_URL=https://repository.apache.org/content/repositories/releases
MANIFEST_JAR_URL="$MAVEN_BASE_URL/org/apache/nifi/nifi-runtime-manifest/$CURRENT_VERSION/nifi-runtime-manifest-$CURRENT_VERSION.jar"
MANIFEST_JAR_PATH=$RESOURCES_DIR/nifi-runtime-manifest.jar
MANIFEST_JSON=nifi-runtime-manifest.json
MANIFEST_DOCS_DIR=docs
NIFI_DOCS_ZIP_URL="$MAVEN_BASE_URL/org/apache/nifi/nifi-docs/$CURRENT_VERSION/nifi-docs-$CURRENT_VERSION-resources.zip"
NIFI_DOCS_ZIP_PATH=$RESOURCES_DIR/nifi-docs-resources.zip
# Create Hugo directories
if [ ! -d $RESOURCES_DIR ];then
mkdir $RESOURCES_DIR
fi
# Download Runtime Manifest JAR and extract JSON to prebuild
echo "Downloading $MANIFEST_JAR_URL"
curl -o $MANIFEST_JAR_PATH $MANIFEST_JAR_URL
unzip -q -o -d $PREBUILD_DIR/assets $MANIFEST_JAR_PATH $MANIFEST_JSON $MANIFEST_DOCS_DIR/*
# Download Documentation Resources and extract to prebuild
echo "Downloading $NIFI_DOCS_ZIP_URL"
curl -o $NIFI_DOCS_ZIP_PATH $NIFI_DOCS_ZIP_URL
unzip -q -o -d $PREBUILD_DIR/public $NIFI_DOCS_ZIP_PATH
# Build components using prebuild directory with Hugo
hugo -s $PREBUILD_DIR