auto-format #20
22
.drone.yml
22
.drone.yml
@ -108,14 +108,16 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- rustc --version
|
- rustc --version
|
||||||
- cargo --version
|
- cargo --version
|
||||||
|
|
||||||
# Stupid workarounds, for stupid problems
|
# Stupid workarounds, for stupid problems
|
||||||
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
- echo "nameserver 1.1.1.1" >> /etc/resolv.conf
|
||||||
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
|
||||||
- rustup component add rustfmt
|
- rustup component add rustfmt
|
||||||
- cargo fmt --all --check && echo "No formatting required, exiting early..." && exit 0
|
- cargo fmt --all --check && echo "No formatting required, exiting early..." && exit 0
|
||||||
- cargo fmt --all --verbose
|
- cargo fmt --all --verbose
|
||||||
- apk add git openssh
|
- apk add git openssh gpg
|
||||||
- '[ $(git log -1 --pretty=%B | grep -E ".+") = "rustfmt" ] && echo "format loop detected, aborting..." && exit 1'
|
- '[ $(git log -1 --pretty=%B | grep -E ".+") = "rustfmt" ] && echo "format loop detected, aborting..." && exit 1'
|
||||||
|
|
||||||
- mkdir -p "$${HOME}/.ssh"
|
- mkdir -p "$${HOME}/.ssh"
|
||||||
- echo "$SSH_PRIVATE_KEY" > "$${HOME}/.ssh/git"
|
- echo "$SSH_PRIVATE_KEY" > "$${HOME}/.ssh/git"
|
||||||
- echo "Host git.libre.moe" >> "$${HOME}/.ssh/config"
|
- echo "Host git.libre.moe" >> "$${HOME}/.ssh/config"
|
||||||
@ -124,15 +126,23 @@ steps:
|
|||||||
- echo "$GITEA_ED25519_SIG" >> "$${HOME}/.ssh/known_hosts"
|
- echo "$GITEA_ED25519_SIG" >> "$${HOME}/.ssh/known_hosts"
|
||||||
- echo "$GITEA_RSA_SIG" >> "$${HOME}/.ssh/known_hosts"
|
- echo "$GITEA_RSA_SIG" >> "$${HOME}/.ssh/known_hosts"
|
||||||
- echo "$GITEA_ECDSA_SIG" >> "$${HOME}/.ssh/known_hosts"
|
- echo "$GITEA_ECDSA_SIG" >> "$${HOME}/.ssh/known_hosts"
|
||||||
- cat "$${HOME}/.ssh/config"
|
|
||||||
- chmod 700 -R "$${HOME}/.ssh"
|
- chmod 700 -R "$${HOME}/.ssh"
|
||||||
|
|
||||||
|
- echo "$GPG_PRIVKEY" > /tmp/private.key
|
||||||
|
- gpg --import /tmp/private.key
|
||||||
|
|
||||||
- git config --local user.name "WANessa"
|
- git config --local user.name "WANessa"
|
||||||
- git config --local user.email "$GIT_EMAIL_ADDRESS"
|
- git config --local user.email "$GIT_EMAIL_ADDRESS"
|
||||||
|
- git config --local user.signingkey "$GPG_PUBKEY_ID"
|
||||||
|
- git config --local gpg.program "/usr/bin/gpg --passphrase '$GPG_PASSPHRASE'"
|
||||||
|
- echo "'$GIT_EMAIL_ADDRESS'"
|
||||||
# Uncomment below line for ssh debugging
|
# Uncomment below line for ssh debugging
|
||||||
# - git config core.sshCommand '/usr/bin/ssh -v'
|
# - git config core.sshCommand '/usr/bin/ssh -v'
|
||||||
- git remote add ssh "$DRONE_GIT_SSH_URL"
|
- git remote add ssh "$DRONE_GIT_SSH_URL"
|
||||||
- GIT_COMMITTER_NAME="WANessa" GIT_COMMITTER_EMAIL="$GIT_EMAIL_ADDRESS" git commit --author "$DRONE_COMMIT_AUTHOR_NAME <$DRONE_COMMIT_AUTHOR_EMAIL>" -am "rustfmt"
|
|
||||||
|
- GIT_COMMITTER_NAME="WANessa" GIT_COMMITTER_EMAIL="$GIT_EMAIL_ADDRESS" git commit --author "$DRONE_COMMIT_AUTHOR_NAME <$DRONE_COMMIT_AUTHOR_EMAIL>" -Sam "rustfmt"
|
||||||
- git push ssh
|
- git push ssh
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
SSH_PRIVATE_KEY:
|
SSH_PRIVATE_KEY:
|
||||||
from_secret: WANESSA_SSH_PRIVKEY
|
from_secret: WANESSA_SSH_PRIVKEY
|
||||||
@ -144,6 +154,12 @@ steps:
|
|||||||
from_secret: GIT_RSA_SIG
|
from_secret: GIT_RSA_SIG
|
||||||
GITEA_ECDSA_SIG:
|
GITEA_ECDSA_SIG:
|
||||||
from_secret: GIT_ECDSA_SIG
|
from_secret: GIT_ECDSA_SIG
|
||||||
|
GPG_PUBKEY_ID:
|
||||||
|
from_secret: WANESSA_GPG_PUBKEY_ID
|
||||||
|
GPG_PASSPHRASE:
|
||||||
|
from_secret: WANESSA_GPG_PASSPHRASE
|
||||||
|
GPG_PRIVKEY:
|
||||||
|
from_secret: WANESSA_GPG_PRIVKEY
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- amd64 [debug]
|
- amd64 [debug]
|
||||||
|
Reference in New Issue
Block a user