[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
This commit is contained in:
Alexander Samusev
2022-07-22 15:22:15 +02:00
committed by GitHub
parent 7ad9cb90aa
commit d6334447ae
+43 -17
View File
@@ -46,6 +46,14 @@ default:
paths: paths:
- ./artifacts/ - ./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 .kubernetes-env: &kubernetes-env
retry: retry:
max: 2 max: 2
@@ -559,27 +567,29 @@ build-rustdoc:
script: script:
# FIXME: it fails with `RUSTDOCFLAGS="-Dwarnings"` and `--all-features` # 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 # 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 - rm -f ./target/doc/.lock
- mv ./target/doc ./crate-docs - mv ./target/doc ./crate-docs
# FIXME: remove me after CI image gets nonroot # FIXME: remove me after CI image gets nonroot
- chown -R nonroot:nonroot ./crate-docs - chown -R nonroot:nonroot ./crate-docs
- echo "<meta http-equiv=refresh content=0;url=polkadot_service/index.html>" > ./crate-docs/index.html - 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 stage: stage3
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs: needs:
- job: check-transaction-versions - job: test-deterministic-wasm
artifacts: false artifacts: false
<<: *test-refs <<: *test-refs
<<: *docker-env <<: *docker-env
image: <<: *collect-artifacts-short
name: michaelfbryan/mdbook-docker-image:v0.4.4
entrypoint: [""]
script: script:
- cargo install mdbook mdbook-mermaid mdbook-linkcheck
- mdbook build ./roadmap/implementers-guide - 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: check-try-runtime:
stage: stage3 stage: stage3
@@ -858,7 +868,12 @@ publish-rustdoc:
needs: needs:
- job: build-rustdoc - job: build-rustdoc
artifacts: true artifacts: true
- job: build-implementers-guide
artifacts: true
script: script:
# Save README and docs
- cp -r ./crate-docs/ /tmp/doc/
- cp -r ./artifacts/book/ /tmp/
# setup ssh # setup ssh
- eval $(ssh-agent) - eval $(ssh-agent)
- ssh-add - <<< ${GITHUB_SSH_PRIV_KEY} - ssh-add - <<< ${GITHUB_SSH_PRIV_KEY}
@@ -870,13 +885,19 @@ publish-rustdoc:
- git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git" - git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin gh-pages - git fetch origin gh-pages
# Save README and docs
- cp -r ./crate-docs/ /tmp/doc/
- cp ./README.md /tmp/doc/
- git checkout gh-pages - git checkout gh-pages
# Remove everything and restore generated docs and README # Remove everything and restore generated docs and README
- cp index.html /tmp
- cp README.md /tmp
- rm -rf ./* - 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 # Upload files
- git add --all --force - git add --all --force
# `git commit` has an exit code of > 0 if there is nothing to commit. # `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. # 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 # 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. # to fail the pipeline as soon as possible to shorten the feedback loop.
cancel-pipeline: .cancel-pipeline-template:
stage: .post stage: .post
needs:
- job: test-linux-stable
artifacts: false
- job: check-try-runtime
artifacts: false
rules: rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
when: on_failure when: on_failure
@@ -934,4 +950,14 @@ cancel-pipeline:
PIPELINE_ID: "${CI_PIPELINE_ID}" PIPELINE_ID: "${CI_PIPELINE_ID}"
trigger: "parity/infrastructure/ci_cd/pipeline-stopper" 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