|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +BLUE='\033[0;38;5;26;48;5;254m' |
| 4 | +BOLD='\033[1;38;5;26;48;5;254m' |
| 5 | +NC='\033[0m' |
| 6 | + |
| 7 | +function print_help() |
| 8 | +{ |
| 9 | + printf "$BLUE Welcome to a helper tool for$BOLD Spine Event Engine$BLUE! $NC\n" |
| 10 | + printf "$BLUE Usage: spine.sh <command> $NC\n" |
| 11 | + printf "$BLUE $NC\n" |
| 12 | + printf "$BLUE Here is a list of available commands: $NC\n" |
| 13 | + printf "$BLUE •$BOLD about$BLUE — a brief description of the framework, $NC\n" |
| 14 | + printf "$BLUE •$BOLD why$BLUE — our motivation to create Spine in the first place, $NC\n" |
| 15 | + printf "$BLUE •$BOLD licensing$BLUE — terms of licensing, $NC\n" |
| 16 | + printf "$BLUE •$BOLD releases$BLUE — information on Spine releases, $NC\n" |
| 17 | + printf "$BLUE •$BOLD quickstart$BLUE — git-clone our 'Hello' application. $NC\n" |
| 18 | +} |
| 19 | + |
| 20 | +if [ -z "$1" ] |
| 21 | +then |
| 22 | + print_help |
| 23 | +else |
| 24 | + case $1 in |
| 25 | + about) |
| 26 | + printf "$BLUE Spine Event Engine is open-source CQRS/Event Sourcing framework. $NC\n" |
| 27 | + printf "$BLUE for building cloud applications DDD way. $NC\n" |
| 28 | + ;; |
| 29 | + why) |
| 30 | + printf "$BLUE Founded in$BOLD 2015$BLUE, Spine is an answer to challenges: $NC\n" |
| 31 | + printf "$BLUE $NC\n" |
| 32 | + printf "$BLUE • Business want to get value$BOLD faster$BLUE. $NC\n" |
| 33 | + printf "$BLUE • We need a$BOLD common language$BLUE between business and developers. $NC\n" |
| 34 | + printf "$BLUE • Too much boilerplate code. $NC\n" |
| 35 | + printf "$BLUE • Existing tools$BOLD aren't enough$BLUE, as we tried many since 2010, when we first adopted DDD. $NC\n" |
| 36 | + ;; |
| 37 | + licensing) |
| 38 | + printf "$BLUE Licensed under$BOLD Apache 2.0$BLUE, with commercial support. $NC\n" |
| 39 | + ;; |
| 40 | + releases) |
| 41 | + printf "$BLUE Latest:$BOLD 1.9.0$BLUE, $NC\n" |
| 42 | + printf "$BLUE (30+ more releases). $NC\n" |
| 43 | + ;; |
| 44 | + quickstart) |
| 45 | + git --version 2>&1 >/dev/null |
| 46 | + GIT_IS_AVAILABLE=$? |
| 47 | + # ... |
| 48 | + if [ $GIT_IS_AVAILABLE -eq 0 ]; |
| 49 | + then |
| 50 | + printf "$BLUE Cloning$BOLD 'Spine-examples/hello'$BLUE into './hello'... $NC\n" |
| 51 | + git clone https://github.com/spine-examples/hello.git |
| 52 | + else |
| 53 | + printf "$BLUE $BOLD 'git'$BLUE is not available in your PATH. Please install it, and repeat the action. $NC\n" |
| 54 | + fi |
| 55 | + ;; |
| 56 | + |
| 57 | + *) |
| 58 | + print_help |
| 59 | + ;; |
| 60 | + esac |
| 61 | +fi |
0 commit comments