Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy documentation automatically #211

Merged
merged 3 commits into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 45 additions & 2 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,36 @@ tasks:
owner: cdenizet@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml

- taskId: {$eval: as_slugid("build_documentation")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hour'}
provisionerId: proj-relman
workerType: ci
payload:
maxRunTime: 3600
image: "rust:buster"
command:
- "/bin/bash"
- "-cx"
- "git clone --recursive --quiet ${repository} &&
Luni-4 marked this conversation as resolved.
Show resolved Hide resolved
cd rust-code-analysis &&
git -c advice.detachedHead=false checkout ${head_rev} &&
cargo install mdbook --no-default-features --features search,output --vers \"^0.1.0\" &&
Luni-4 marked this conversation as resolved.
Show resolved Hide resolved
Luni-4 marked this conversation as resolved.
Show resolved Hide resolved
cargo doc --release &&
cd rust-code-analysis-book &&
mdbook build &&
tar -zvcf /book.tar.gz book/"
artifacts:
public/book.tar.gz:
expires: {$fromNow: '2 weeks'}
path: /book.tar.gz
type: file
metadata:
name: rust-code-analysis documentation
description: rust-code-analysis build documentation
owner: cdenizet@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml

- taskId: {$eval: as_slugid("ccov_test_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
Expand Down Expand Up @@ -244,6 +274,7 @@ tasks:
dependencies:
- {$eval: as_slugid("build_linux_release")}
- {$eval: as_slugid("strip_windows_binary")}
- {$eval: as_slugid("build_documentation")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hour'}
provisionerId: proj-relman
Expand All @@ -254,13 +285,25 @@ tasks:
features:
taskclusterProxy: true
maxRunTime: 3600
image: "mozilla/taskboot:0.2.5"
image: "mozilla/taskboot:0.2.7"
env:
TASKCLUSTER_SECRET: project/relman/rust-code-analysis/deploy
command:
- "/bin/sh"
- "-cx"
- "taskboot github-release mozilla/rust-code-analysis ${version} --asset ${linux_artifact}:public/${linux_artifact} ${windows_artifact}:public/${windows_artifact}"
- "git clone --recursive --quiet https://github.com/SoftengPoliTo/rust-code-analysis &&
Luni-4 marked this conversation as resolved.
Show resolved Hide resolved
cd rust-code-analysis &&
taskboot retrieve-artifact --output-path=. \
--artifacts=public/book.tar.gz &&
tar xfz book.tar.gz -C rust-code-analysis-book &&
git config --global user.email you@example.com &&
Luni-4 marked this conversation as resolved.
Show resolved Hide resolved
git config --global user.name Your Name &&
Luni-4 marked this conversation as resolved.
Show resolved Hide resolved
./rust-code-analysis-book/deploy-to-GitHub-Pages &&
taskboot git-push --force-push \
github.com/mozilla/rust-code-analysis \
moz-tools-bot \
gh-pages &&
taskboot github-release mozilla/rust-code-analysis ${version} --asset ${linux_artifact}:public/${linux_artifact} ${windows_artifact}:public/${windows_artifact}"
metadata:
name: "rust-code-analysis release publication ${version}"
description: rust-code-analysis release publication on Github
Expand Down
4 changes: 1 addition & 3 deletions rust-code-analysis-book/deploy-to-GitHub-Pages
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
[ -d /tmp/book ] || (git worktree prune && git branch -D gh-pages)

git worktree add -b gh-pages /tmp/book
mdbook build
rm -rf /tmp/book/* # this won't delete the .git directory
cp -rp book/* /tmp/book/
cp -rp rust-code-analysis-book/book/* /tmp/book/
cd /tmp/book
git add -A
git commit -m "Deploy rust-code-analysis"
git push -f origin gh-pages