Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Host compiler documentation #40

Merged
merged 2 commits into from
Apr 2, 2018
Merged
Changes from all commits
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
25 changes: 23 additions & 2 deletions promote-release/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,18 +387,39 @@ upload-addr = \"{}/{}\"
drop(fs::remove_dir_all(&docs));
t!(fs::create_dir_all(&docs));
let target = "x86_64-unknown-linux-gnu";

// Unpack the regular documentation tarball.
let tarball_prefix = format!("rust-docs-{}-{}", version, target);
let tarball = format!("{}.tar.gz",
self.dl_dir().join(&tarball_prefix).display());
let tarball_dir = format!("{}/rust-docs/share/doc/rust/html",
tarball_prefix);
let tarball_dir = format!("{}/rust-docs/share/doc/rust/html", tarball_prefix);
run(Command::new("tar")
.arg("xf")
.arg(&tarball)
.arg("--strip-components=6")
.arg(&tarball_dir)
.current_dir(&docs));

// Construct path to rustc documentation.
let tarball_prefix = format!("rustc-docs-{}-{}", version, target);
let tarball = format!("{}.tar.gz",
self.dl_dir().join(&tarball_prefix).display());

// Only create and unpack rustc docs if artefacts include tarball.
if Path::new(&tarball).exists() {
// Create the subdirectory that we will extract our nighly documentation into.
let tarball_dir = format!("{}/nightly-rustc", tarball_dir);
t!(fs::create_dir_all(&tarball_dir));

// Unpack the rustc documentation into the new directory.
run(Command::new("tar")
.arg("xf")
.arg(&tarball)
.arg("--strip-components=6")
.arg(&tarball_dir)
.current_dir(&docs));
}

// Upload this to `/doc/$channel`
let bucket = self.secrets["dist"]["upload-bucket"].as_str().unwrap();
let dst = format!("s3://{}/doc/{}/", bucket, upload_dir);
Expand Down