Skip to content
代码片段 群组 项目
未验证 提交 cf299857 编辑于 作者: Jennifer Li's avatar Jennifer Li 提交者: GitLab
浏览文件

Run docs jobs with custom exit code

上级 b2a7ebcc
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
...@@ -47,10 +47,15 @@ docs-lint markdown: ...@@ -47,10 +47,15 @@ docs-lint markdown:
needs: [] needs: []
script: script:
- source ./scripts/utils.sh - source ./scripts/utils.sh
- yarn_install_script - |
- install_gitlab_gem function docs_lint_markdown() {
- scripts/lint-doc.sh yarn_install_script
- scripts/lint/check_mermaid.mjs install_gitlab_gem
scripts/lint-doc.sh
scripts/lint/check_mermaid.mjs
}
run_with_custom_exit_code docs_lint_markdown
docs code_quality: docs code_quality:
extends: extends:
...@@ -97,8 +102,10 @@ docs-lint links: ...@@ -97,8 +102,10 @@ docs-lint links:
- .docs-markdown-lint-image - .docs-markdown-lint-image
stage: lint stage: lint
needs: [] needs: []
before_script:
- source scripts/utils.sh
script: script:
- lychee --offline --no-progress --include-fragments doc - run_with_custom_exit_code lychee --offline --no-progress --include-fragments doc
docs-lint deprecations-and-removals: docs-lint deprecations-and-removals:
variables: variables:
...@@ -111,8 +118,13 @@ docs-lint deprecations-and-removals: ...@@ -111,8 +118,13 @@ docs-lint deprecations-and-removals:
stage: lint stage: lint
needs: [] needs: []
script: script:
- bundle exec rake gitlab:docs:check_deprecations - |
- bundle exec rake gitlab:docs:check_windows function docs_lint_deprecations_and_removals() {
bundle exec rake gitlab:docs:check_deprecations
bundle exec rake gitlab:docs:check_windows
}
run_with_custom_exit_code docs_lint_deprecations_and_removals
docs-lint redirects: docs-lint redirects:
image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}-alpine image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}-alpine
...@@ -121,5 +133,7 @@ docs-lint redirects: ...@@ -121,5 +133,7 @@ docs-lint redirects:
- .default-retry - .default-retry
- .docs:rules:redirect-check - .docs:rules:redirect-check
needs: [] needs: []
before_script:
- source scripts/utils.sh
script: script:
- ./scripts/lint-docs-redirects.rb - run_with_custom_exit_code ./scripts/lint-docs-redirects.rb
...@@ -546,9 +546,11 @@ function run_with_custom_exit_code() { ...@@ -546,9 +546,11 @@ function run_with_custom_exit_code() {
set +e # temporarily disable exit on error to prevent premature exit set +e # temporarily disable exit on error to prevent premature exit
# runs command passed in as argument, save standard error and standard output # runs command passed in as argument, save standard error and standard output
output=$("$@" 2>&1) output=$(set -e; "$@" 2>&1)
initial_exit_code=$? initial_exit_code=$?
echo "initial_exit_code: $initial_exit_code"
local trace_file="stdout_stderr_log.out" local trace_file="stdout_stderr_log.out"
echo "$output" | tee "$trace_file" echo "$output" | tee "$trace_file"
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册