This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] publish parachain-implementers-guide (#5806)
* [Do not merge] [ci] publish parachain-implementers-guide * fix .cancel-pipeline * rename build-implementers-guide * fix * debig docs * fix needs * debug publish * change image for impl guide job * fix mdbook * add folder * remove mdbook-graphviz * fix publish * fix publish * debug publish * remove debug * fix script order * return pipeline * remove test ref from publish
- Loading branch information
Showing
1 changed file
with
43 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,14 @@ default: | |
paths: | ||
- ./artifacts/ | ||
|
||
.collect-artifacts-short: &collect-artifacts-short | ||
artifacts: | ||
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" | ||
when: on_success | ||
expire_in: 1 days | ||
paths: | ||
- ./artifacts/ | ||
|
||
.kubernetes-env: &kubernetes-env | ||
retry: | ||
max: 2 | ||
|
@@ -559,27 +567,29 @@ build-rustdoc: | |
script: | ||
# FIXME: it fails with `RUSTDOCFLAGS="-Dwarnings"` and `--all-features` | ||
# FIXME: return to stable when https://github.com/rust-lang/rust/issues/96937 gets into stable | ||
- time cargo +nightly doc --workspace --verbose | ||
- time cargo +nightly doc --workspace --verbose --no-deps | ||
- rm -f ./target/doc/.lock | ||
- mv ./target/doc ./crate-docs | ||
# FIXME: remove me after CI image gets nonroot | ||
- chown -R nonroot:nonroot ./crate-docs | ||
- echo "<meta http-equiv=refresh content=0;url=polkadot_service/index.html>" > ./crate-docs/index.html | ||
- sccache -s | ||
|
||
generate-impl-guide: | ||
build-implementers-guide: | ||
stage: stage3 | ||
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs | ||
needs: | ||
- job: check-transaction-versions | ||
- job: test-deterministic-wasm | ||
artifacts: false | ||
<<: *test-refs | ||
<<: *docker-env | ||
image: | ||
name: michaelfbryan/mdbook-docker-image:v0.4.4 | ||
entrypoint: [""] | ||
<<: *collect-artifacts-short | ||
script: | ||
- cargo install mdbook mdbook-mermaid mdbook-linkcheck | ||
- mdbook build ./roadmap/implementers-guide | ||
- mkdir -p artifacts | ||
- mv roadmap/implementers-guide/book artifacts/ | ||
# FIXME: remove me after CI image gets nonroot | ||
- chown -R nonroot:nonroot artifacts/ | ||
|
||
check-try-runtime: | ||
stage: stage3 | ||
|
@@ -858,7 +868,12 @@ publish-rustdoc: | |
needs: | ||
- job: build-rustdoc | ||
artifacts: true | ||
- job: build-implementers-guide | ||
artifacts: true | ||
script: | ||
# Save README and docs | ||
- cp -r ./crate-docs/ /tmp/doc/ | ||
- cp -r ./artifacts/book/ /tmp/ | ||
# setup ssh | ||
- eval $(ssh-agent) | ||
- ssh-add - <<< ${GITHUB_SSH_PRIV_KEY} | ||
|
@@ -870,13 +885,19 @@ publish-rustdoc: | |
- git config remote.origin.url "[email protected]:/paritytech/${CI_PROJECT_NAME}.git" | ||
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" | ||
- git fetch origin gh-pages | ||
# Save README and docs | ||
- cp -r ./crate-docs/ /tmp/doc/ | ||
- cp ./README.md /tmp/doc/ | ||
- git checkout gh-pages | ||
# Remove everything and restore generated docs and README | ||
- cp index.html /tmp | ||
- cp README.md /tmp | ||
- rm -rf ./* | ||
- mv /tmp/doc/* . | ||
# dir for rustdoc | ||
- mkdir -p doc | ||
# dir for implementors guide | ||
- mkdir -p book | ||
- mv /tmp/doc/* doc/ | ||
- mv /tmp/book/html/* book/ | ||
- mv /tmp/index.html . | ||
- mv /tmp/README.md . | ||
# Upload files | ||
- git add --all --force | ||
# `git commit` has an exit code of > 0 if there is nothing to commit. | ||
|
@@ -919,13 +940,8 @@ short-benchmark-westend: | |
# This job cancels the whole pipeline if any of provided jobs fail. | ||
# In a DAG, every jobs chain is executed independently of others. The `fail_fast` principle suggests | ||
# to fail the pipeline as soon as possible to shorten the feedback loop. | ||
cancel-pipeline: | ||
.cancel-pipeline-template: | ||
stage: .post | ||
needs: | ||
- job: test-linux-stable | ||
artifacts: false | ||
- job: check-try-runtime | ||
artifacts: false | ||
rules: | ||
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs | ||
when: on_failure | ||
|
@@ -934,4 +950,14 @@ cancel-pipeline: | |
PIPELINE_ID: "${CI_PIPELINE_ID}" | ||
trigger: "parity/infrastructure/ci_cd/pipeline-stopper" | ||
|
||
cancel-pipeline-test-linux-stable: | ||
extends: .cancel-pipeline-template | ||
needs: | ||
- job: test-linux-stable | ||
artifacts: false | ||
|
||
cancel-pipeline-check-try-runtime: | ||
extends: .cancel-pipeline-template | ||
needs: | ||
- job: check-try-runtime | ||
artifacts: false |