From 098b1138c6508005977a0561aa1a041a7e79dffc Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Thu, 17 Mar 2022 23:52:41 +0000 Subject: [PATCH] Add CI config --- .ci/known_hosts | 1 + .ci/woodpecker/check.yml | 16 ++++++++++++++++ .ci/woodpecker/manual.yml | 16 ++++++++++++++++ .ci/woodpecker/release.yml | 39 ++++++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- book.toml | 13 +++++++++++++ 6 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 .ci/known_hosts create mode 100644 .ci/woodpecker/check.yml create mode 100644 .ci/woodpecker/manual.yml create mode 100644 .ci/woodpecker/release.yml create mode 100644 book.toml 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/.ci/woodpecker/check.yml b/.ci/woodpecker/check.yml new file mode 100644 index 0000000..95aa67f --- /dev/null +++ b/.ci/woodpecker/check.yml @@ -0,0 +1,16 @@ +# must set build pipeline as .woodpecker/ with the trailing slash to activate the +# multiple pipelines + +platform: linux/amd64 + +pipeline: + clippy: + when: + event: [push, pull_request] + image: rust:1.59.0-slim + commands: + - apt-get -qq update && apt-get -yqq install pkg-config libssl-dev build-essential + - cargo install sqlx-cli --features sqlite + #- rustup component add clippy + # TODO clippy one day + - cargo check --all diff --git a/.ci/woodpecker/manual.yml b/.ci/woodpecker/manual.yml new file mode 100644 index 0000000..8e1bc8e --- /dev/null +++ b/.ci/woodpecker/manual.yml @@ -0,0 +1,16 @@ +platform: linux/arm64 + +pipeline: + deployManual: + image: docker.bics.ga/rei_ci/mdbook:latest-arm64 + when: + branch: + - main + secrets: + - deploy_ssh_key + commands: # warning! Doesn't seem to like hashed known_hosts... + - 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 ./book/ space_docs_librepush_net@sallie.librepush.net:./public/quickpeep + - rm /tmp/rsync_key diff --git a/.ci/woodpecker/release.yml b/.ci/woodpecker/release.yml new file mode 100644 index 0000000..973e213 --- /dev/null +++ b/.ci/woodpecker/release.yml @@ -0,0 +1,39 @@ +# Building a release + +platform: linux/${ARCH} + +matrix: + ARCH: + - arm64 + - amd64 + +.a1: &when + event: tag + tag: v* + +pipeline: + buildRelease: + when: *when + + image: "rust:1.59.0" + commands: + - apt-get -qq update && apt-get -yqq install pkg-config libssl-dev build-essential + - "qualsuff=`echo -$WOODPECKER_TAG-$WOODPECKER_ARCH | sed s%/%-%`" + - mkdir dist + - cargo install --path quickpeep --bins --root dist + - cargo install --path quickpeep_raker --bins --root dist + - cargo install --path quickpeep_indexer --bins --root dist + - cp -r scripts dist/ + - "tar Jcvf quickpeep-$qualsuff.tar.xz" + + uploadRelease: + when: *when + image: plugins/gitea-release + base_url: https://bics.ga + checksum: + - sha256 + files: + - "quickpeep-*.tar.xz" + secrets: + - source: gitea_token + target: plugin_api_key diff --git a/.gitignore b/.gitignore index dd5cfc9..73573ef 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ quickpeep_static/.parcel-cache quickpeep_static/dist quickpeep_static/node_modules quickpeep/testdb.sqlite -qp_web.ron \ No newline at end of file +qp_web.ron +dist \ No newline at end of file diff --git a/book.toml b/book.toml new file mode 100644 index 0000000..6bf295c --- /dev/null +++ b/book.toml @@ -0,0 +1,13 @@ +[book] +authors = ["Olivier"] +language = "en" +multilingual = false +src = "docs" +title = "QuickPeep Documentation" +description = "Documentation for QuickPeep" + +[output.html] +default-theme = "coal" +git-repository-url = "https://bics.ga/reivilibre/quickpeep.git" +git-repository-icon = "fa-git-alt" +fold = { enable = true, level = 1 }