You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.2 KiB
51 lines
1.2 KiB
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
VDN_PATH=$(readlink -f $(dirname $(command -v vdn))/..)
|
|
. $VDN_PATH/bin/functions.sh
|
|
|
|
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
|
|
}
|
|
|
|
for arg; do
|
|
case "$arg" in
|
|
'-h')
|
|
help; exit
|
|
;;
|
|
--)
|
|
break
|
|
;;
|
|
esac
|
|
done
|
|
|
|
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 $*"
|