This repository was archived by the owner on Nov 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +49
-19
lines changed
Expand file tree Collapse file tree 3 files changed +49
-19
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,13 @@ windows_environment: &windows_environment
195195 BUCK_NUM_THREADS : 3
196196 BUCK_PEX_LOCATION : " ./new_buck.pex"
197197
198+ tags_only_filter : &tags_only_filter
199+ filters :
200+ tags :
201+ only : /^v20.*/
202+ branches :
203+ ignore : /.*/
204+
198205jobs :
199206 linux_build_openjdk8 :
200207 environment :
@@ -1226,6 +1233,36 @@ jobs:
12261233 python3 ./tools/release/publish_release.py --no-build-deb --no-build-homebrew --github-token ${GITHUB_TOKEN} --chocolatey-token ${CHOCO_TOKEN} --use-existing-release --version ${VERSION} --output-dir artifacts
12271234 shell : bash.exe
12281235
1236+ publish_docs :
1237+ environment :
1238+ << : *linux_environment
1239+ working_directory : " /home/circleci/buck"
1240+ machine :
1241+ image : ubuntu-1604:201903-01
1242+ steps :
1243+ - checkout
1244+ - run :
1245+ << : *install_openjdk8
1246+ - run :
1247+ # android_sdk needed to build java docs.
1248+ << : *install_android_sdk
1249+ - run :
1250+ << : *install_python
1251+ - run :
1252+ # We do not want to build buck, install the latest release instead.
1253+ name : Install Buck
1254+ command : |
1255+ url=`curl -sH "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/facebook/buck/releases/latest |grep "browser_download_url.*deb" |awk '{gsub("\"", "", $2); print $2}'`
1256+ curl -L -O $url
1257+ filename=`basename ${url}`
1258+ sudo dpkg -i ${filename} || echo "Warning: Buck installed without dependencies."
1259+ - run :
1260+ name : Publish docs
1261+ command : |
1262+ export ANDROID_HOME="${ANDROID_SDK}"
1263+ cd docs
1264+ ./publish.sh --start-soyweb
1265+
12291266workflows :
12301267 version : 2.1
12311268 linux_jobs :
@@ -1260,20 +1297,10 @@ workflows:
12601297 publish_jobs :
12611298 jobs :
12621299 - macos_publish_release :
1263- filters :
1264- tags :
1265- only : /^v20.*/
1266- branches :
1267- ignore : /.*/
1300+ << : *tags_only_filter
12681301 - linux_publish_release :
1269- filters :
1270- tags :
1271- only : /^v20.*/
1272- branches :
1273- ignore : /.*/
1302+ << : *tags_only_filter
12741303 - windows_publish_release :
1275- filters :
1276- tags :
1277- only : /^v20.*/
1278- branches :
1279- ignore : /.*/
1304+ << : *tags_only_filter
1305+ - publish_docs :
1306+ << : *tags_only_filter
Original file line number Diff line number Diff line change 3838 exit 1
3939}
4040
41+ GIT_USER=" buck-bot"
42+ CNAME=" buck.build"
4143START_SOYWEB=0
4244KEEP_FILES=0
4345SOYWEB_PID=0
@@ -83,7 +85,7 @@ echo "Documentation working directory is ${STATIC_FILES_DIR}"
8385# Create a clean checkout of the gh-pages branch with no data:
8486if [ -z " $1 " ]
8587then
86- git clone git @github.com: facebook/buck.git $STATIC_FILES_DIR
88+ git clone https:// ${GIT_USER} : ${GITHUB_TOKEN} @github.com/ facebook/buck.git $STATIC_FILES_DIR
8789else
8890 cp -r " $1 " $STATIC_FILES_DIR
8991fi
101103
102104# Commit the new version of the docs:
103105cd $STATIC_FILES_DIR
106+ echo " ${CNAME} " > CNAME
107+ git config --global user.name " ${GIT_USER} "
104108git add .
105109git commit -m " Updated HTML documentation."
106110
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ def main(output_dir):
5757 ):
5858 # Copy the static resource to output_dir.
5959 relative_path = os .path .join (root , file_name )
60- with open (relative_path ) as resource_file :
60+ with open (relative_path , "rb" ) as resource_file :
6161 resource = resource_file .read ()
6262 copy_to_output_dir (relative_path , output_dir , resource )
6363
@@ -74,7 +74,7 @@ def ensure_dir(path, output_dir):
7474
7575def copy_to_output_dir (path , output_dir , content ):
7676 output_file = ensure_dir (path , output_dir )
77- with open (output_file , "w " ) as f :
77+ with open (output_file , "wb " ) as f :
7878 f .write (content )
7979
8080
@@ -88,7 +88,6 @@ def pollForServerReady():
8888 time .sleep (1 )
8989 print ("Server failed to start after %s seconds." % SERVER_START_POLL )
9090
91-
9291if __name__ == "__main__" :
9392 output_dir = sys .argv [1 ]
9493 pollForServerReady ()
You can’t perform that action at this time.
0 commit comments