From 04175ddc8336487a19e0c739cbe416de981a886e Mon Sep 17 00:00:00 2001 From: gabriel klawitter Date: Wed, 16 Jan 2019 12:17:57 +0100 Subject: [PATCH] [CI] Publish rustdoc (#1446) * build rust docs and publish them on s3 * fix yaml anchors * debug i * debug fix * typo * add doc build caching * cache doc artifacts * test caching * more caching, aws tuning * debug i * debug ii * rework caching * send to substrate_service/index.html per default --- substrate/.gitlab-ci.yml | 100 ++++++++++++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 18 deletions(-) diff --git a/substrate/.gitlab-ci.yml b/substrate/.gitlab-ci.yml index 6b5f331216..bc3b831389 100644 --- a/substrate/.gitlab-ci.yml +++ b/substrate/.gitlab-ci.yml @@ -1,5 +1,7 @@ # .gitlab-ci.yml -# + + + stages: - test - build @@ -19,8 +21,8 @@ variables: cache: key: "${CI_JOB_NAME}" paths: - - ./.cargo/ - + - ${CARGO_HOME} + - ./target .collect_artifacts: &collect_artifacts artifacts: @@ -65,21 +67,26 @@ test:rust:stable: &test + +.build_only: &build_only + only: + - master + - tags + - web + + #### stage: build build:rust:linux:release: &build stage: build <<: *collect_artifacts - only: - - master - - tags - - web + <<: *build_only tags: - linux-docker before_script: - ./scripts/build.sh script: - - time cargo build --release --verbose; + - time cargo build --release --verbose - mkdir -p ./artifacts - mv ./target/release/substrate ./artifacts/. - echo -n "Substrate version = " @@ -90,22 +97,42 @@ build:rust:linux:release: &build - -#### stage: publish - -.publish: &publish - stage: publish - dependencies: - - build:rust:linux:release - cache: {} +build:rust:doc:release: &build + stage: build + artifacts: + name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc" + when: on_success + expire_in: 7 days + paths: + - ./crate-docs only: - master - tags - web + - publish-rustdoc + tags: + - linux-docker + script: + - time cargo doc --release --verbose + - cp -R ./target/doc ./crate-docs + - echo "" > ./crate-docs/index.html + + + + +#### stage: publish + +.publish_build: &publish_build + stage: publish + dependencies: + - build:rust:linux:release + cache: {} + <<: *build_only + publish:docker:release: - <<: *publish + <<: *publish_build tags: - shell variables: @@ -126,7 +153,7 @@ publish:docker:release: publish:s3:release: - <<: *publish + <<: *publish_build image: parity/awscli:latest variables: GIT_STRATEGY: none @@ -141,3 +168,40 @@ publish:s3:release: +publish:s3:doc: + stage: publish + dependencies: + - build:rust:doc:release + cache: {} + only: + - master + - tags + - web + - publish-rustdoc + variables: + GIT_STRATEGY: none + BUCKET: "releases.parity.io" + PREFIX: "substrate-rustdoc" + before_script: + - mkdir -p ${HOME}/.aws + - | + cat > ${HOME}/.aws/config <