From 7b4d91dc76961032e7bb0ef63b54c33af677debe Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Wed, 28 Jul 2021 21:32:28 +0100 Subject: [PATCH] Build and deploy manual in CI --- .ci/known_hosts | 1 + .drone.yml | 46 +++++++++++++++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 .ci/known_hosts diff --git a/.ci/known_hosts b/.ci/known_hosts new file mode 100644 index 0000000..e3d5a87 --- /dev/null +++ b/.ci/known_hosts @@ -0,0 +1 @@ +sallie.librepush.net,79.143.178.141 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHPJu+9XaDuDQA8jVdD++BSkazgVUt1c22oa+FoWiqWVWAVu33+Jh3Evc4s3HK6jMMuOIVs8AVnGAUY5eaqmJik= diff --git a/.drone.yml b/.drone.yml index 49c1097..7636263 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,20 +6,36 @@ platform: arch: arm64 steps: -- name: unit tests - image: rust:1.49.0-slim - commands: - - apt-get -qq update && apt-get -yqq install pkg-config libssl-dev build-essential libsqlite3-dev - - cargo build --verbose --all - - cargo test --verbose --all + - name: unit tests + image: rust:1.49.0-slim + commands: + - apt-get -qq update && apt-get -yqq install pkg-config libssl-dev build-essential libsqlite3-dev + - cargo build --verbose --all + - cargo test --verbose --all -- name: test suite - image: rust:1.53.0-slim-bullseye - commands: - - apt-get -qq update && apt-get -yqq install pkg-config libssl-dev build-essential libsqlite3-dev python3.9 python3.9-venv - - cargo install --path yama - - cargo install --path datman - - python3.9 -m venv testsuite/.venv - - ./testsuite/.venv/bin/pip install -e testsuite - - cd testsuite && ./.venv/bin/green + - name: test suite + image: rust:1.53.0-slim-bullseye + commands: + - apt-get -qq update && apt-get -yqq install pkg-config libssl-dev build-essential libsqlite3-dev python3.9 python3.9-venv + - cargo install --path yama + - cargo install --path datman + - python3.9 -m venv testsuite/.venv + - ./testsuite/.venv/bin/pip install -e testsuite + - cd testsuite && ./.venv/bin/green + - name: deploy manual + image: rust:1.53.0-slim + when: + branch: + - develop + environment: + DEPLOY_SSH_KEY: + from_secret: DEPLOY_SSH_KEY + commands: # warning! Doesn't seem to like hashed known_hosts... + - cargo install mdbook + - cd docs + - mdbook build + - echo "$DEPLOY_SSH_KEY" > /tmp/rsync_key + - chmod u=rw,go= /tmp/rsync_key + - rsync -e 'ssh -i /tmp/rsync_key -o "UserKnownHostsFile .ci/known_hosts"' -vaz --delete ./docs/book space_docs_librepush_net@sallie.librepush.net:./public/yama + - rm /tmp/rsync_key