SSH_HOST_KEY_DISABLE, add drone pipline
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
a990dc27c7
commit
d6e90e04ba
28
.drone.yml
Normal file
28
.drone.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: linters
|
||||||
|
steps:
|
||||||
|
- name: run shellcheck
|
||||||
|
image: koalaman/shellcheck-alpine
|
||||||
|
commands:
|
||||||
|
- shellcheck backup.sh
|
||||||
|
|
||||||
|
- name: publish image
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
auto_tag: true
|
||||||
|
username: thecoopcloud
|
||||||
|
password:
|
||||||
|
from_secret: thecoopcloud_password
|
||||||
|
repo: thecoopcloud/abra
|
||||||
|
tags: latest
|
||||||
|
depends_on:
|
||||||
|
- run shellcheck
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
@ -21,11 +21,13 @@ if [ -n "$ssh_key_file" ] && [ -f "$ssh_key_file" ]; then
|
|||||||
if [ -n "$SSH_HOST_KEY" ]; then
|
if [ -n "$SSH_HOST_KEY" ]; then
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
echo "$SSH_HOST_KEY" >> "$tmpfile"
|
echo "$SSH_HOST_KEY" >> "$tmpfile"
|
||||||
|
echo "using host key $SSH_HOST_KEY"
|
||||||
ssh_options="-o 'UserKnownHostsFile $tmpfile'"
|
ssh_options="-o 'UserKnownHostsFile $tmpfile'"
|
||||||
elif [ "$SSH_HOST_KEY_DISABLE" = "1" ]; then
|
elif [ "$SSH_HOST_KEY_DISABLE" = "1" ]; then
|
||||||
|
echo "disabling SSH host key checking"
|
||||||
ssh_options="-o 'StrictHostKeyChecking=No'"
|
ssh_options="-o 'StrictHostKeyChecking=No'"
|
||||||
else
|
else
|
||||||
echo "Neither SSH_HOST_KEY nor SSH_HOST_KEY_DISABLE set"
|
echo "neither SSH_HOST_KEY nor SSH_HOST_KEY_DISABLE set"
|
||||||
fi
|
fi
|
||||||
restic_extra_options="sftp.command=ssh $ssh_options -i $ssh_key_file $restic_host -s sftp"
|
restic_extra_options="sftp.command=ssh $ssh_options -i $ssh_key_file $restic_host -s sftp"
|
||||||
fi
|
fi
|
||||||
@ -37,7 +39,7 @@ if [ -n "$s3_key_file" ] && [ -f "$s3_key_file" ] && [ -n "$AWS_ACCESS_KEY_ID" ]
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$restic_repo" ]; then
|
if [ -z "$restic_repo" ]; then
|
||||||
echo "You must configure either SFTP or S3 storage, see README"
|
echo "you must configure either SFTP or S3 storage, see README"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- SSH_KEY_FILE=/run/secrets/ssh_key
|
- SSH_KEY_FILE=/run/secrets/ssh_key
|
||||||
- SSH_HOST_KEY
|
- SSH_HOST_KEY
|
||||||
|
- SSH_HOST_KEY_DISABLE
|
||||||
secrets:
|
secrets:
|
||||||
- source: ssh_key
|
- source: ssh_key
|
||||||
mode: 0400
|
mode: 0400
|
||||||
|
Loading…
x
Reference in New Issue
Block a user