Add vdn-drone

main
Clément FRÉVILLE 1 year ago
parent 33fc5e8c6a
commit 4a4e30e14d

@ -25,6 +25,10 @@ cp completion/vdn-completion.bash /usr/local/share/bash-completion/completions/v
grep 'complete -F \w* [a-z-]*' -- completion/vdn-completion.bash | awk '{ print "/usr/local/share/bash-completion/completions/"$NF }' | xargs -I {} ln -s /usr/local/share/bash-completion/completions/vdn {} grep 'complete -F \w* [a-z-]*' -- completion/vdn-completion.bash | awk '{ print "/usr/local/share/bash-completion/completions/"$NF }' | xargs -I {} ln -s /usr/local/share/bash-completion/completions/vdn {}
``` ```
## `vdn-drone`
Execute your pipeline locally.
## `vdn-rsync` ## `vdn-rsync`
Copy files between the host and the guest system using *rsync*. Copy files between the host and the guest system using *rsync*.

@ -0,0 +1,50 @@
#!/bin/bash
set -eu
VDN_PATH=$(readlink -f $(dirname $(command -v vdn))/..)
. $VDN_PATH/bin/functions.sh
synopsis() {
cat << EOF
Usage : $(basename $0) [-h] [option...]
EOF
}
help() {
cat << EOF
$(basename $0) exécute une pipeline Drone locale dans VDN.
$(synopsis)
-h : affiche cette aide
--help : affiche l'aide de Drone
Les options autorisées sont celles de drone(1).
Exemple :
# Exécute la pipeline par défaut en passant des paramètres
# de dépôt
vdn-drone exec --pipeline default --repo octocat/hello-world --branch main
# Exécute la pipeline par défaut pour un évènement tag
vdn-drone exec --event tag --env-file .env
EOF
}
usage() {
synopsis
exit 1
}
test -f .drone.yml || error 'Aucun fichier drone.yml trouvé'
vdn-set-network-dir docker
vdn-ssh root@debian-1 "export https_proxy=$http_proxy; if ! test -f /usr/local/bin/drone; then curl -L https://github.com/harness/drone-cli/releases/latest/download/drone_linux_amd64.tar.gz | tar zx && install -t /usr/local/bin drone; fi"
vdn-ssh root@debian-1 "rm -rf /tmp/$PWD"
vdn-rsync -a --filter=':- .gitignore' --relative $PWD test@debian-1:/tmp
vdn-ssh test@debian-1 "export https_proxy=$https_proxy; cd /tmp$PWD && drone $*"
Loading…
Cancel
Save