add druid version correctly (#8586)

This commit is contained in:
Vadim Ogievetsky 2019-09-24 18:19:06 -07:00 committed by Clint Wylie
parent 0467cce7a0
commit 563718c5b2
3 changed files with 18 additions and 14 deletions

View File

@ -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>

View File

@ -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

View File

@ -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) {