From ebe65374e380ba830aca724309658f149161158f Mon Sep 17 00:00:00 2001 From: xuechun Lei Date: Mon, 9 Apr 2018 11:09:36 +0800 Subject: [PATCH 1/4] build: add conditional branch for pdf generating --- circle.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/circle.yml b/circle.yml index eb3898e8d702..bfeea5986ab6 100644 --- a/circle.yml +++ b/circle.yml @@ -5,6 +5,10 @@ jobs: docker: - image: andelf/doc-build:0.1.9 working_directory: ~/pingcap/docs-cn + branches: + only: + - master + # - website-preview steps: - checkout From 3cf2937d813f86391a5102843e9a639e9819145b Mon Sep 17 00:00:00 2001 From: xuechun Lei Date: Mon, 9 Apr 2018 11:26:36 +0800 Subject: [PATCH 2/4] build: test pdf preview generating conditional branch --- circle.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/circle.yml b/circle.yml index bfeea5986ab6..4520df723b43 100644 --- a/circle.yml +++ b/circle.yml @@ -8,6 +8,7 @@ jobs: branches: only: - master + - xuechun/polish-ci-pdf-generating # - website-preview steps: - checkout @@ -31,6 +32,10 @@ jobs: sudo bash -c 'echo "119.188.128.5 uc.qbox.me" >> /etc/hosts'; python3 scripts/upload.py output.pdf tidb-manual-cn.pdf; fi + if [ "${CIRCLE_BRANCH}" == "xuechun/polish-ci-pdf-generating" ]; then + sudo bash -c 'echo "119.188.128.5 uc.qbox.me" >> /etc/hosts'; + python3 scripts/upload.py output.pdf tidb-manual-cn-preview.pdf; + fi - run: name: "Copy Generated PDF" From 9e56dbc031e3ea59d70cb0d8163df2fa7cbb5e1f Mon Sep 17 00:00:00 2001 From: xuechun Lei Date: Mon, 9 Apr 2018 11:35:30 +0800 Subject: [PATCH 3/4] chore: replace test pdf preview conditional branch to formal pdf preview branch --- circle.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/circle.yml b/circle.yml index 4520df723b43..fb320e22d11c 100644 --- a/circle.yml +++ b/circle.yml @@ -8,8 +8,7 @@ jobs: branches: only: - master - - xuechun/polish-ci-pdf-generating - # - website-preview + - website-preview steps: - checkout @@ -32,7 +31,7 @@ jobs: sudo bash -c 'echo "119.188.128.5 uc.qbox.me" >> /etc/hosts'; python3 scripts/upload.py output.pdf tidb-manual-cn.pdf; fi - if [ "${CIRCLE_BRANCH}" == "xuechun/polish-ci-pdf-generating" ]; then + if [ "${CIRCLE_BRANCH}" == "website-preview" ]; then sudo bash -c 'echo "119.188.128.5 uc.qbox.me" >> /etc/hosts'; python3 scripts/upload.py output.pdf tidb-manual-cn-preview.pdf; fi From 1c0b76666fe314de79b872166761f6a90bbaf0be Mon Sep 17 00:00:00 2001 From: xuechun Lei Date: Mon, 9 Apr 2018 13:28:01 +0800 Subject: [PATCH 4/4] polish: mv modify `/etc/hosts` outside the conditional process handle --- circle.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index fb320e22d11c..cdd7f0cf1bae 100644 --- a/circle.yml +++ b/circle.yml @@ -27,12 +27,11 @@ jobs: - deploy: name: "Publish PDF" command: | + sudo bash -c 'echo "119.188.128.5 uc.qbox.me" >> /etc/hosts'; if [ "${CIRCLE_BRANCH}" == "master" ]; then - sudo bash -c 'echo "119.188.128.5 uc.qbox.me" >> /etc/hosts'; python3 scripts/upload.py output.pdf tidb-manual-cn.pdf; fi if [ "${CIRCLE_BRANCH}" == "website-preview" ]; then - sudo bash -c 'echo "119.188.128.5 uc.qbox.me" >> /etc/hosts'; python3 scripts/upload.py output.pdf tidb-manual-cn-preview.pdf; fi