mirror of https://github.com/apache/druid.git
add druid version correctly (#8586)
This commit is contained in:
parent
0467cce7a0
commit
563718c5b2
|
@ -84,6 +84,7 @@
|
|||
<configuration>
|
||||
<executable>script/build-to-docs</executable>
|
||||
<arguments>
|
||||
<argument>${website.version}</argument>
|
||||
<argument>${website.version}</argument>
|
||||
<argument>${website.src}</argument>
|
||||
</arguments>
|
||||
|
@ -99,6 +100,7 @@
|
|||
<executable>script/build-to-docs</executable>
|
||||
<arguments>
|
||||
<argument>latest</argument>
|
||||
<argument>${website.version}</argument>
|
||||
<argument>${website.src}</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
|
|
|
@ -16,19 +16,20 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if [ "$#" -ne 1 ] && [ "$#" -ne 2 ]; then
|
||||
if [ "$#" -ne 2 ] && [ "$#" -ne 3 ]; then
|
||||
echo "Illegal number of parameters, should one or two: the version, or the version and website-src directory";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
VERSION=$1
|
||||
URL_VERSION=$1
|
||||
DRUID_VERSION=$2
|
||||
WEBSRC="../../incubator-druid-website-src"
|
||||
|
||||
if [ "$#" -gt 1 ]; then
|
||||
WEBSRC=$2
|
||||
if [ "$#" -gt 2 ]; then
|
||||
WEBSRC=$3
|
||||
fi
|
||||
|
||||
echo "Building to docs for '$VERSION' to $WEBSRC ..."
|
||||
echo "Building to docs for '$URL_VERSION' to $WEBSRC ..."
|
||||
|
||||
npm run compile-scss
|
||||
|
||||
|
@ -42,13 +43,13 @@ else
|
|||
rm build-log.txt
|
||||
fi
|
||||
|
||||
node script/fix-path.js $VERSION
|
||||
node script/fix-path.js $URL_VERSION $DRUID_VERSION
|
||||
|
||||
echo "Cleaning..."
|
||||
rm -rf $WEBSRC/docs/$VERSION/
|
||||
mkdir -p $WEBSRC/docs/$VERSION/
|
||||
rm -rf $WEBSRC/docs/$URL_VERSION/
|
||||
mkdir -p $WEBSRC/docs/$URL_VERSION/
|
||||
|
||||
cp -r ./build/ApacheDruid/docs/* $WEBSRC/docs/$VERSION/
|
||||
cp -r ./build/ApacheDruid/docs/* $WEBSRC/docs/$URL_VERSION/
|
||||
|
||||
mkdir -p $WEBSRC/css
|
||||
cp ./build/ApacheDruid/css/* $WEBSRC/css
|
||||
|
|
|
@ -18,26 +18,27 @@
|
|||
|
||||
const replace = require('replace-in-file');
|
||||
|
||||
if (process.argv.length !== 3) {
|
||||
console.log('Usage: node fix-path.js 0.16.0');
|
||||
if (process.argv.length !== 4) {
|
||||
console.log('Usage: node fix-path.js latest 0.16.0-incubating');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var version = process.argv[2];
|
||||
var urlVersion = process.argv[2];
|
||||
var druidVersion = process.argv[3];
|
||||
|
||||
try {
|
||||
// Fix doc paths
|
||||
replace.sync({
|
||||
files: './build/ApacheDruid/docs/**/*.html',
|
||||
from: /\/docs\//g,
|
||||
to: '/docs/' + version + '/',
|
||||
to: '/docs/' + urlVersion + '/',
|
||||
});
|
||||
|
||||
// Interpolate {{DRUIDVERSION}}
|
||||
replace.sync({
|
||||
files: './build/ApacheDruid/docs/**/*.html',
|
||||
from: /\{\{DRUIDVERSION\}\}/g,
|
||||
to: version,
|
||||
to: druidVersion,
|
||||
});
|
||||
console.log('Fixed versions');
|
||||
} catch (error) {
|
||||
|
|
Loading…
Reference in New Issue