decoupling-drupal-vuejs/drupal/.docksal/commands/init

38 lines
1 KiB
Plaintext
Raw Normal View History

2019-06-05 18:35:24 +00:00
#!/usr/bin/env bash
2019-06-05 20:29:17 +00:00
## Initialize stack and site (full reset)
2019-06-05 18:35:24 +00:00
##
## Usage: fin init
2019-06-05 20:29:17 +00:00
# Abort if anything fails
set -e
2019-06-05 18:35:24 +00:00
2019-06-05 20:29:17 +00:00
#-------------------------- Helper functions --------------------------------
2019-06-05 18:35:24 +00:00
2019-06-05 20:29:17 +00:00
# Console colors
red='\033[0;31m'
green='\033[0;32m'
green_bg='\033[1;97;42m'
yellow='\033[1;33m'
NC='\033[0m'
2019-06-05 20:01:21 +00:00
2019-06-05 20:29:17 +00:00
echo-red () { echo -e "${red}$1${NC}"; }
echo-green () { echo -e "${green}$1${NC}"; }
echo-green-bg () { echo -e "${green_bg}$1${NC}"; }
echo-yellow () { echo -e "${yellow}$1${NC}"; }
2019-06-05 18:35:24 +00:00
2019-06-05 20:29:17 +00:00
#-------------------------- Execution --------------------------------
2019-06-05 18:35:24 +00:00
2019-06-05 20:29:17 +00:00
# Stack initialization
echo -e "${green_bg} Step 1 ${NC}${green} Initializing stack...${NC}"
fin project reset -f
2019-06-05 18:35:24 +00:00
2019-06-05 20:29:17 +00:00
# Site initialization
echo -e "${green_bg} Step 2 ${NC}${green} Initializing site...${NC}"
# This runs inside cli using http://docs.docksal.io/en/v1.4.0/fin/custom-commands/#executing-commands-inside-cli
fin init-site
2019-06-05 18:35:24 +00:00
2019-06-05 20:29:17 +00:00
echo -e "${green_bg} DONE! ${NC}${green} Completed all initialization steps.${NC}"
2019-06-05 18:35:24 +00:00
2019-06-05 20:29:17 +00:00
#-------------------------- END: Execution --------------------------------