From 5cfcca74a7b3263b5c9bd209343a21dc24e809da Mon Sep 17 00:00:00 2001 From: Yandrik Date: Wed, 24 Apr 2024 11:29:40 +0200 Subject: [PATCH] ci: switched to template --- .drone.yml | 44 +++++--------------------------------------- pipeline.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 pipeline.yml diff --git a/.drone.yml b/.drone.yml index a405078..2fbd861 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,39 +1,5 @@ -kind: pipeline -name: default - -steps: -- name: test - image: rust:1.77.2-slim - commands: - - cargo build --verbose --all - - cargo test --verbose --all -- name: test_fmt - image: rust:1.77.2-slim - commands: - - cargo fmt -- --check - failure: ignore -- name: deploy - image: rust:1.77.2-slim - commands: - - echo "deploying staging..." - when: - event: - include: [ promote ] - target: - include: [ staging ] - depends_on: - - test - - test_fmt - -- name: deploy_prod - image: rust:1.77.2-slim - commands: - - echo "deploying production..." - when: - event: - include: [ promote ] - target: - include: [ production ] - depends_on: - - test - - test_fmt +kind: template +load: template.yml +data: + rust_img: "rust:1.77.2" + rust_ver: "1.77.2" diff --git a/pipeline.yml b/pipeline.yml new file mode 100644 index 0000000..f136d59 --- /dev/null +++ b/pipeline.yml @@ -0,0 +1,40 @@ + +kind: pipeline +name: default + +steps: +- name: test + image: rust:{{ .input.rust_ver }} + commands: + - cargo build --verbose --all + - cargo test --verbose --all +- name: test_fmt + image: rustdocker/rustfmt:{{ .input.rust_ver }} + commands: + - cargo fmt -- --check + failure: ignore +- name: deploy + image: rust:{{ .input.rust_ver }} + commands: + - echo "deploying staging..." + when: + event: + include: [ promote ] + target: + include: [ staging ] + depends_on: + - test + - test_fmt + +- name: deploy_prod + image: rust:{{ .input.rust_ver }} + commands: + - echo "deploying production..." + when: + event: + include: [ promote ] + target: + include: [ production ] + depends_on: + - test + - test_fmt