v1: modify fallback ping message
parent
82076cfd88
commit
4bd19c7fc2
15
v1.sh
15
v1.sh
|
@ -65,6 +65,11 @@ function write_log() {
|
||||||
echo "[$(now)] $@"
|
echo "[$(now)] $@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function write_separator() {
|
||||||
|
char=$1
|
||||||
|
echo "$(printf "%0.s$char" {1..80})"
|
||||||
|
}
|
||||||
|
|
||||||
payload=$1
|
payload=$1
|
||||||
service=$2
|
service=$2
|
||||||
event=$3
|
event=$3
|
||||||
|
@ -174,9 +179,9 @@ if [[ ! -z $script_path ]]; then
|
||||||
|
|
||||||
write_log "Executing script..."
|
write_log "Executing script..."
|
||||||
|
|
||||||
echo "================================================================================"
|
write_separator "="
|
||||||
$script_path
|
$script_path
|
||||||
echo "================================================================================"
|
write_separator "="
|
||||||
|
|
||||||
write_log "Removing working directory..."
|
write_log "Removing working directory..."
|
||||||
rm -rf $build_path
|
rm -rf $build_path
|
||||||
|
@ -196,11 +201,9 @@ if [[ ! -z $script_path ]]; then
|
||||||
echo " Started: $started_time"
|
echo " Started: $started_time"
|
||||||
else
|
else
|
||||||
if [[ $event == "ping" ]]; then
|
if [[ $event == "ping" ]]; then
|
||||||
if [[ $(command -v figlet &> /dev/null) ]]; then
|
|
||||||
figlet "Pong!"
|
|
||||||
else
|
|
||||||
echo "Pong!"
|
echo "Pong!"
|
||||||
fi
|
echo ""
|
||||||
|
echo "If you're seeing this, that means you've done something right. To trigger scripts on events place them in '$script_base_dir/$service/$repo_author/$repo_name/<event>.sh'."
|
||||||
else
|
else
|
||||||
die "No handler for $event on $service:$repo"
|
die "No handler for $event on $service:$repo"
|
||||||
fi
|
fi
|
||||||
|
|
Reference in New Issue