simplify CI config

This commit is contained in:
Ritesh Chitlangi 2021-11-24 22:55:49 +08:00
parent 0d99bfa601
commit 458f39a6ed
1 changed files with 17 additions and 39 deletions

View File

@ -10,14 +10,10 @@ steps:
- name: check
image: ayravat/rust:1.56.1-ci
volumes:
- name: ssh
path: /root/.ssh
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
- name: config
path: /root/.config/epp-client
commands:
- export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH
@ -27,14 +23,10 @@ steps:
- name: fmt
image: ayravat/rust:1.56.1-ci
volumes:
- name: ssh
path: /root/.ssh
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
- name: config
path: /root/.config/epp-client
commands:
- export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH
@ -44,14 +36,10 @@ steps:
- name: clippy
image: ayravat/rust:1.56.1-ci
volumes:
- name: ssh
path: /root/.ssh
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
- name: config
path: /root/.config/epp-client
commands:
- export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH
@ -61,14 +49,10 @@ steps:
- name: test
image: ayravat/rust:1.56.1-ci
volumes:
- name: ssh
path: /root/.ssh
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
- name: config
path: /root/.config/epp-client
commands:
- export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH
@ -78,21 +62,17 @@ steps:
- name: crates.io
image: ayravat/rust:1.56.1-docker
volumes:
- name: ssh
path: /root/.ssh
- name: target
path: /tmp/cargo-target
- name: cache
path: /tmp/cargo
- name: config
path: /root/.config/epp-client
- name: crates
path: /root/.cargo
environment:
CARGO_TOKEN:
from_secret: cargo_token
commands:
- export CARGO_HOME=/tmp/cargo/$DRONE_BRANCH
- export CARGO_TARGET_DIR=/tmp/cargo-target/$DRONE_BRANCH
- mkdir -p $CARGO_HOME $CARGO_TARGET_DIR
- export CARGO_TOKEN=$(cat $HOME/.cargo/credentials-token)
- cd epp-client
- cargo publish --token $CARGO_TOKEN
- cd ..
@ -106,32 +86,30 @@ steps:
- name: notify
image: drillster/drone-email
volumes:
- name: notify-env
path: /root/.notify-env
environment:
PLUGIN_ENV_FILE: /root/.notify-env
PLUGIN_HOST:
from_secret: mail_host
PLUGIN_FROM:
from_secret: mail_sender
PLUGIN_FROM_NAME:
from_secret: mail_sender_name
PLUGIN_PORT:
from_secret: mail_port
PLUGIN_USERNAME:
from_secret: mail_user
PLUGIN_PASSWORD:
from_secret: mail_password
PLUGIN_RECIPIENTS:
from_secret: mail_recipients
when:
status:
- failure
volumes:
- name: ssh
host:
path: /root/.ssh
- name: config
host:
path: /root/.config/epp-client
- name: crates
host:
path: /root/.cargo
- name: target
host:
path: /var/drone/cache/epp-client-target
- name: cache
host:
path: /var/drone/cache/epp-client-cache
- name: notify-env
host:
path: /root/.notify-env
...