This repository has been archived by the owner on Jun 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from alibaba/master
merge
- Loading branch information
Showing
7 changed files
with
138 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
::############################################################################### | ||
:: 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. | ||
::############################################################################### | ||
|
||
@echo off | ||
:start | ||
call jekyll -version >nul 2>&1 | ||
if "%errorlevel%"=="0" goto check_redcarpet | ||
echo ERROR: Could not find jekyll. | ||
echo Please install with 'gem install jekyll' (see http://jekyllrb.com). | ||
exit /b 1 | ||
|
||
:check_redcarpet | ||
call redcarpet -version >nul 2>&1 | ||
if "%errorlevel%"=="0" goto check_pygments | ||
echo ERROR: Could not find redcarpet. | ||
echo Please install with 'gem install redcarpet' (see https://github.com/vmg/redcarpet). | ||
echo Redcarpet is needed for Markdown parsing and table of contents generation. | ||
exit /b 1 | ||
|
||
:check_pygments | ||
call python -c "import pygments" >nul 2>&1 | ||
if "%errorlevel%"=="0" goto check_git | ||
echo ERROR: Could not find pygments. | ||
echo Please install with 'sudo easy_install Pygments' (requires Python; see http://pygments.org). | ||
echo Pygments is needed for syntax highlighting of the code examples. | ||
exit /b 1 | ||
|
||
:check_git | ||
call git --version >nul 2>&1 | ||
if "%errorlevel%"=="0" goto execute | ||
echo ERROR: Could not find Git. | ||
echo Please install Git and add it into $PATH. | ||
echo Git is needed for auto-deploy. | ||
exit /b 1 | ||
|
||
:execute | ||
SET "DOCS_SRC=%cd%" | ||
SET "DOCS_DST=%DOCS_SRC%\_site" | ||
SET "DEPLOY_DATE=%date:~0,10% %time:~0,2%:%time:~3,2%" | ||
|
||
::build doc | ||
echo Start to build doc by Jekyll... | ||
call jekyll build >nul 2>&1 | ||
echo Build complete... | ||
|
||
::push pages to github.com | ||
echo Setting up Git deployment... | ||
call rm -rf .deploy_tmp | ||
call mkdir .deploy_tmp | ||
call cp -r _site/* .deploy_tmp/ >nul 2>&1 | ||
echo Deploying... | ||
call cd .deploy_tmp | ||
call rm -rf jekyll/ | ||
call rm deploy.bat | ||
call git config --global http.postBuffer 8528000 >nul 2>&1 | ||
call git init >nul 2>&1 | ||
call git add -A >nul 2>&1 | ||
call git commit -m "updated: %DEPLOY_DATE%" >nul 2>&1 | ||
call git push -u https://github.com/alibaba/jstorm.git HEAD:documents --force | ||
call cd .. | ||
call rm -rf .deploy_tmp | ||
echo Deploy successfully! | ||
echo Press any key to exit | ||
pause >nul 2>&1 | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
HAS_JEKYLL=true | ||
|
||
command -v jekyll > /dev/null | ||
if [ $? -ne 0 ]; then | ||
echo -n "ERROR: Could not find jekyll. " | ||
echo "Please install with 'gem install jekyll' (see http://jekyllrb.com)." | ||
|
||
HAS_JEKYLL=false | ||
exit | ||
fi | ||
|
||
command -v redcarpet > /dev/null | ||
if [ $? -ne 0 ]; then | ||
echo -n "WARN: Could not find redcarpet. " | ||
echo -n "Please install with 'sudo gem install redcarpet' (see https://github.com/vmg/redcarpet). " | ||
echo "Redcarpet is needed for Markdown parsing and table of contents generation." | ||
fi | ||
|
||
command -v pygmentize > /dev/null | ||
if [ $? -ne 0 ]; then | ||
echo -n "WARN: Could not find pygments. " | ||
echo -n "Please install with 'sudo easy_install Pygments' (requires Python; see http://pygments.org). " | ||
echo "Pygments is needed for syntax highlighting of the code examples." | ||
fi | ||
|
||
echo "Start to build doc by Jekyll..." | ||
jekyll build > /dev/null | ||
echo "Build complete..." | ||
|
||
echo "Setting up Git deployment..." | ||
rm -rf .deploy_tmp | ||
mkdir .deploy_tmp | ||
cp -r _site/* .deploy_tmp/ > /dev/null | ||
echo "Deploying..." | ||
cd .deploy_tmp | ||
rm -rf jekyll/ | ||
rm deploy.bat | ||
git config --global http.postBuffer 8528000 > /dev/null | ||
git init > /dev/null | ||
git add -A > /dev/null | ||
git commit -m "updated documents" > /dev/null | ||
git push -u https://github.com/alibaba/jstorm.git HEAD:documents --force | ||
cd .. | ||
rm -rf .deploy_tmp | ||
echo "Deploy successfully!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters