Skip to content

Commit

Permalink
feat(docs&docs-cn): enable upload pdf and context report (#2915)
Browse files Browse the repository at this point in the history
enable upload pdf and context report.

---------

Signed-off-by: purelind <purelind@gmail.com>
  • Loading branch information
purelind committed Apr 15, 2024
1 parent fccab0e commit 0fb820c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 31 deletions.
27 changes: 14 additions & 13 deletions pipelines/pingcap/docs-cn/latest/merged_update_docs_cn.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pipeline {
FILE_SERVER_URL = 'http://fileserver.pingcap.net'
}
options {
timeout(time: 40, unit: 'MINUTES')
timeout(time: 45, unit: 'MINUTES')
parallelsAlwaysFailFast()
}
stages {
Expand Down Expand Up @@ -58,7 +58,7 @@ pipeline {
}
}
stage('Build pdf') {
options { timeout(time: 30, unit: 'MINUTES') }
options { timeout(time: 45, unit: 'MINUTES') }
steps {
dir("docs-cn") {
withCredentials([
Expand All @@ -79,17 +79,18 @@ pipeline {
python3 scripts/merge_by_toc.py
scripts/generate_pdf.sh
"""
// // TODO: uncomment this line after pipeline test passed
// sh label: 'Upload pdf', script: """#!/usr/bin/env bash
// if [ "${REFS.base_ref}" = "master" ]; then
// python3 scripts/upload.py output.pdf tidb-dev-zh-manual.pdf;
// elif [ "${REFS.base_ref}" = "release-7.5" ]; then
// python3 scripts/upload.py output.pdf tidb-stable-zh-manual.pdf;
// elif case "${REFS.base_ref}" in release-*) ;; *) false;; esac; then
// python3 scripts/upload.py output.pdf tidb-v${REFS.base_ref##*-}-zh-manual.pdf;
// fi
// """
}
// TODO: uncomment this line after pipeline test passed
sh label: 'Upload pdf', script: """#!/usr/bin/env bash
target_version=\$(echo ${REFS.base_ref} | sed 's/release-//')
if [ "${REFS.base_ref}" = "master" ]; then
python3 scripts/upload.py output.pdf tidb-dev-zh-manual.pdf;
elif [ "${REFS.base_ref}" = "release-7.5" ]; then
python3 scripts/upload.py output.pdf tidb-stable-zh-manual.pdf;
elif case "${REFS.base_ref}" in release-*) ;; *) false;; esac; then
python3 scripts/upload.py output.pdf tidb-v\${target_version}-zh-manual.pdf;
fi
"""
}
}
}
}
Expand Down
29 changes: 15 additions & 14 deletions pipelines/pingcap/docs/latest/merged_update_docs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pipeline {
FILE_SERVER_URL = 'http://fileserver.pingcap.net'
}
options {
timeout(time: 40, unit: 'MINUTES')
timeout(time: 45, unit: 'MINUTES')
parallelsAlwaysFailFast()
}
stages {
Expand Down Expand Up @@ -59,7 +59,7 @@ pipeline {
}
}
stage('Build pdf') {
options { timeout(time: 30, unit: 'MINUTES') }
options { timeout(time: 45, unit: 'MINUTES') }

steps {
dir("docs") {
Expand All @@ -81,18 +81,19 @@ pipeline {
python3 scripts/merge_by_toc.py
scripts/generate_pdf.sh
"""
// TODO: uncomment this line after pipeline test passed
// sh label: 'Upload pdf', script: """#!/usr/bin/env bash
// if [ "${REFS.base_ref}" = "master" ]; then
// python3 scripts/upload.py output.pdf tidb-dev-en-manual.pdf;
// elif [ "${REFS.base_ref}" = "release-7.5" ]; then
// python3 scripts/merge_by_toc.py TOC-tidb-cloud.md doc_cloud.md tidb-cloud; scripts/generate_cloud_pdf.sh;
// python3 scripts/upload.py output_cloud.pdf tidbcloud-en-manual.pdf;
// python3 scripts/upload.py output.pdf tidb-stable-en-manual.pdf;
// elif case "${REFS.base_ref}" in release-*) ;; *) false;; esac; then
// python3 scripts/upload.py output.pdf tidb-v${REFS.base_ref##*-}-en-manual.pdf;
// fi
// """

sh label: 'Upload pdf', script: """#!/usr/bin/env bash
target_version=\$(echo ${REFS.base_ref} | sed 's/release-//')
if [ "${REFS.base_ref}" = "master" ]; then
python3 scripts/upload.py output.pdf tidb-dev-en-manual.pdf;
elif [ "${REFS.base_ref}" = "release-7.5" ]; then
python3 scripts/merge_by_toc.py TOC-tidb-cloud.md doc_cloud.md tidb-cloud; scripts/generate_cloud_pdf.sh;
python3 scripts/upload.py output_cloud.pdf tidbcloud-en-manual.pdf;
python3 scripts/upload.py output.pdf tidb-stable-en-manual.pdf;
elif case "${REFS.base_ref}" in release-*) ;; *) false;; esac; then
python3 scripts/upload.py output.pdf tidb-v\${target_version}-en-manual.pdf;
fi
"""
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions prow-jobs/pingcap-docs-cn-postsubmits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ postsubmits:
agent: jenkins
decorate: false # need add this.
context: docs-cn/merged-ci
max_concurrency: 1
skip_report: true
max_concurrency: 5
skip_report: false
branches:
- ^master$
- ^release-[3-4].0$
Expand Down
4 changes: 2 additions & 2 deletions prow-jobs/pingcap-docs-postsubmits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ postsubmits:
agent: jenkins
decorate: false # need add this.
context: docs/merged-ci
max_concurrency: 1
skip_report: true
max_concurrency: 5
skip_report: false
branches:
- ^master$
- ^release-[3-4].0$
Expand Down

0 comments on commit 0fb820c

Please sign in to comment.