From eb6a94980a09cff740b91f8f0db7c8ca4ac6c0d5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 21 Sep 2023 18:24:37 +0200 Subject: [PATCH] this should allow automatic book deployment --- automation/Dockerfile | 9 ++++ automation/Jenkinsfile | 118 ++++++++++++++++++++++------------------- 2 files changed, 73 insertions(+), 54 deletions(-) diff --git a/automation/Dockerfile b/automation/Dockerfile index 09132c5..f8912d4 100644 --- a/automation/Dockerfile +++ b/automation/Dockerfile @@ -4,6 +4,7 @@ FROM rust:latest RUN apt-get update RUN apt-get --yes upgrade +RUN apt-get --yes install openssh-client # tzdata is a dependency, won't install otherwise ARG DEBIAN_FRONTEND=noninteractive @@ -13,3 +14,11 @@ ENV CROSS_CONTAINER_IN_CONTAINER=true RUN rustup install nightly && \ rustup target add thumbv7em-none-eabihf armv7-unknown-linux-gnueabihf && \ rustup component add rustfmt clippy +RUN cargo install mdbook --no-default-features --features search --vers "^0.4" --locked + +# SSH stuff to allow deployment to doc server +RUN adduser --uid 114 jenkins + +# Add documentation server to known hosts +RUN echo "|1|/LzCV4BuTmTb2wKnD146l9fTKgQ=|NJJtVjvWbtRt8OYqFgcYRnMQyVw= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts +RUN echo "|1|CcBvBc3EG03G+XM5rqRHs6gK/Gg=|oGeJQ+1I8NGI2THIkJsW92DpTzs= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNL8ssTonYtgiR/6RRlSIK9WU1ywOcJmxFTLcEblAwH7oifZzmYq3XRfwXrgfMpylEfMFYfCU8JRqtmi19xc21A=" >> /etc/ssh/ssh_known_hosts diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 0770614..d7623f4 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -1,59 +1,69 @@ pipeline { - - agent { - dockerfile { - dir 'automation' - reuseNode true - } + agent { + dockerfile { + dir 'automation' + reuseNode true } + } - stages { - stage('Rust Toolchain Info') { - steps { - sh 'rustc --version' - } - } - stage('Clippy') { - steps { - sh 'cargo clippy' - } - } - stage('Docs') { - steps { - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh 'cargo +nightly doc --all-features' - } - } - } - stage('Rustfmt') { - steps { - sh 'cargo fmt --all --check' - } - } - stage('Test') { - steps { - sh 'cargo test --all-features' - } - } - stage('Check with all features') { - steps { - sh 'cargo check --all-features' - } - } - stage('Check with no features') { - steps { - sh 'cargo check --no-default-features' - } - } - stage('Check Cross Embedded Bare Metal') { - steps { - sh 'cargo check -p satrs-core --target thumbv7em-none-eabihf --no-default-features' - } - } - stage('Check Cross Embedded Linux') { - steps { - sh 'cargo check --target armv7-unknown-linux-gnueabihf' - } - } + stages { + stage('Rust Toolchain Info') { + steps { + sh 'rustc --version' + } } + stage('Clippy') { + steps { + sh 'cargo clippy' + } + } + stage('Docs') { + steps { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh 'cargo +nightly doc --all-features' + } + } + } + stage('Rustfmt') { + steps { + sh 'cargo fmt --all --check' + } + } + stage('Test') { + steps { + sh 'cargo test --all-features' + } + } + stage('Check with all features') { + steps { + sh 'cargo check --all-features' + } + } + stage('Check with no features') { + steps { + sh 'cargo check --no-default-features' + } + } + stage('Check Cross Embedded Bare Metal') { + steps { + sh 'cargo check -p satrs-core --target thumbv7em-none-eabihf --no-default-features' + } + } + stage('Check Cross Embedded Linux') { + steps { + sh 'cargo check --target armv7-unknown-linux-gnueabihf' + } + } + stage('Deploy satrs-book') { + steps { + dir('satrs-book') { + mdbook build + sshagent(credentials: ['documentation-buildfix']) { + // Deploy to Apache webserver + sh 'rsync -r --delete book/ buildfix@documentation.irs.uni-stuttgart.de:/projects/sat-rs' + } + } + } + } + } }