v1: modify fallback ping message
parent
82076cfd88
commit
4bd19c7fc2
17
v1.sh
17
v1.sh
|
@ -65,6 +65,11 @@ function write_log() {
|
|||
echo "[$(now)] $@"
|
||||
}
|
||||
|
||||
function write_separator() {
|
||||
char=$1
|
||||
echo "$(printf "%0.s$char" {1..80})"
|
||||
}
|
||||
|
||||
payload=$1
|
||||
service=$2
|
||||
event=$3
|
||||
|
@ -174,9 +179,9 @@ if [[ ! -z $script_path ]]; then
|
|||
|
||||
write_log "Executing script..."
|
||||
|
||||
echo "================================================================================"
|
||||
write_separator "="
|
||||
$script_path
|
||||
echo "================================================================================"
|
||||
write_separator "="
|
||||
|
||||
write_log "Removing working directory..."
|
||||
rm -rf $build_path
|
||||
|
@ -196,11 +201,9 @@ if [[ ! -z $script_path ]]; then
|
|||
echo " Started: $started_time"
|
||||
else
|
||||
if [[ $event == "ping" ]]; then
|
||||
if [[ $(command -v figlet &> /dev/null) ]]; then
|
||||
figlet "Pong!"
|
||||
else
|
||||
echo "Pong!"
|
||||
fi
|
||||
echo "Pong!"
|
||||
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
|
||||
die "No handler for $event on $service:$repo"
|
||||
fi
|
||||
|
|
Reference in New Issue