Christian Legnitto 2019-04-16 21:27:24 -07:00
parent 17e564c6f0
commit 94cc621598
2 changed files with 58 additions and 57 deletions

View file

@ -1,59 +1,58 @@
jobs:
- job: check_formatting
displayName: Check formatting
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
$HOME/.cargo/bin/rustup component add rustfmt
displayName: Install stable Rust
- script: |
$HOME/.cargo/bin/cargo fmt -- --check
displayName: Run rustfmt
- job: check_formatting
displayName: Check formatting
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
$HOME/.cargo/bin/rustup component add rustfmt
displayName: Install stable Rust
- script: |
$HOME/.cargo/bin/cargo fmt -- --check
displayName: Run rustfmt
- job: run_book_tests
displayName: Book code example tests
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
$HOME/.cargo/bin/rustup component add rustfmt
displayName: Install stable Rust
- script: |
cd docs/book/tests && $HOME/.cargo/bin/cargo test
displayName: Test book code examples via skeptic
- job: run_book_tests
displayName: Book code example tests
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
$HOME/.cargo/bin/rustup component add rustfmt
displayName: Install stable Rust
- script: |
cd docs/book/tests && $HOME/.cargo/bin/cargo test
displayName: Test book code examples via skeptic
- job: build_book_master
displayName: Build rendered book on master branch and push to Github
pool:
vmImage: ubuntu-16.04
dependsOn: run_book_tests
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
variables:
- group: github-keys
steps:
- task: InstallSSHKey@0
inputs:
hostName: $(GHSshKnownHosts)
sshPublicKey: $(GHSshPub)
sshKeySecureFile: $(GHSshPriv)
- script: |
./docs/book/ci-build.sh master
- job: build_book_master
displayName: Build rendered book on master branch and push to Github
pool:
vmImage: ubuntu-16.04
dependsOn: run_book_tests
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
variables:
- group: github-keys
steps:
# - task: InstallSSHKey@0
# inputs:
# hostName: $(secret.GHSshKnownHosts)
# sshPublicKey: $(secret.GHSshPub)
# sshKeySecureFile: $(secret.GHSshPriv)
- script: |
./docs/book/ci-build.sh master
- template: _build/azure-pipelines-template.yml
parameters:
name: Linux
vmImage: ubuntu-16.04
- template: _build/azure-pipelines-template.yml
parameters:
name: Linux
vmImage: ubuntu-16.04
- template: _build/azure-pipelines-template.yml
parameters:
name: macOS
vmImage: macOS-10.13
- template: _build/azure-pipelines-template.yml
parameters:
name: macOS
vmImage: macOS-10.13
- template: _build/azure-pipelines-template.yml
parameters:
name: Windows
vmImage: vs2017-win2016
- template: _build/azure-pipelines-template.yml
parameters:
name: Windows
vmImage: vs2017-win2016

View file

@ -1,8 +1,8 @@
#! /usr/bin/env bash
# Usage: ./ci-build.sh VERSION
#
# This script builds the book to HTML with mdbook
#
# This script builds the book to HTML with mdbook
# commits and pushes the contents to the repo in the "gh-pages" branch.
#
# It is only inteded for use on the CI!
@ -29,7 +29,7 @@ if [ $MDBOOK -h ]; then
echo "mdbook found..."
else
echo "mdbook not found. Downloading..."
curl -L https://github.com/rust-lang-nursery/mdBook/releases/download/v0.2.0/mdbook-v0.2.0-x86_64-unknown-linux-gnu.tar.gz | tar xzf -
curl -L https://github.com/rust-lang-nursery/mdBook/releases/download/v0.2.0/mdbook-v0.2.0-x86_64-unknown-linux-gnu.tar.gz | tar xzf -
mv ./mdbook /tmp/mdbook
MDBOOK="/tmp/mdbook"
fi
@ -44,6 +44,8 @@ git clean -fd
git checkout gh-pages
rm -rf $VERSION
mv /tmp/book-content ./$VERSION
git config --local user.name "Juniper Doc Bot"
git config --local user.email "juniper@example.com"
git add -A $VERSION
git commit -m "Updated book for $VERSION"
git commit -m "Updated book for $VERSION ***NO_CI***"
git push origin gh-pages