<commit_before>#!/usr/bin/env bash

## Docker auto-Deployement with Nginx Let's Encrypt support.
## You have too point DNS of your domain to your server, Launch the nginx container
## And finally, you can deploy stack like this :
## $ add_stack.sh --image=wordpress --domain=blog.example.com -e 8111

## Script configuration
##################################################################
pubIP=10.1.1.1
adminMail=<EMAIL>
faddPath=/srv/www
scriptsPath=/srv/scripts
dockerPath=/usr/bin
composePath=/usr/local/bin
logsPath=/path/to/logs

## Catch Args
##################################################################
while test $# -gt 0; do
	case "$1" in
        	-h|--help)
			echo " "
                        echo "Add_Stack.sh -- Create a new Docker deployment"
                        echo " "
                        echo "add_stack.sh [arguments]"
                        echo " "
                        echo "options:"
                        echo "-h, --help                show brief help"
                        echo "-i, --image=IMAGE         specify an image to use"
			echo "-d, --domain=DOMAIN       specify a domain to use"
			echo "-e, --expose=PORT         specify a port to expose the service"
                        exit 0
                        ;;
                -i)
                        shift
                        if test $# -gt 0; then
                                export stackType=$1
                        else
                                echo "no image specified"
                                exit 1
                        fi
                        shift
                        ;;
                --image*)
                        export stackType=`echo $1 | sed -e 's/^[^=]*=//g'`
                        shift
                        ;;
		-d)
                        shift
                        if test $# -gt 0; then
                                export siteName=$1
                        else
                                echo "no domain specified"
                                exit 1
                        fi
                        shift
                        ;;
                --domain*)
                        export siteName=`echo $1 | sed -e 's/^[^=]*=//g'`
                        shift
                        ;;
		-e)
			shift
			if test $# -gt 0; then
				export portWeb=$1
			else
				echo "no port specified"
				exit 1
			fi
			shift
			;;
		--expose*)
			export portWeb=`echo $1 | sed -e 's/^[^=]*=//g'`
			shift
			;;
                *)
                        break
			exit 1
                        ;;
        esac
done

## Make some checks
##################################################################
#set -o errexit
#set -o nounset

### Check args
### Colors
CSI="\033["
CGREEN="${CSI}1;32m"
CRED="${CSI}1;31m"
CEND="${CSI}0m"
echo
logsFile=$(echo "$logsPath"/"$domain".log)
echo "Let's create `tput bold`$siteName`tput sgr0`..." 2>&1 | tee -a $logsFile
echo
if [ -z $siteName ]; then
	echo -e "       Make some verifications        [${CRED}FAIL${CEND}]"
	echo
	echo "Have you forget a Domain for your stack ? Check --help"
  exit 1
fi
if [ -z $portWeb ]; then
	echo -e "       Make some verifications        [${CRED}FAIL${CEND}]"
	echo
	echo "Have you forget a Port for your stack ? Check --help"
  exit 1
fi
if [ -z $stackType ]; then
	echo -e "       Make some verifications        [${CRED}FAIL${CEND}]"
	echo
	echo "Have you forget an Image for your stack ? Check --help"
  exit 1
fi
<commit_msg>Logs finally Working !!<commit_after>#!/usr/bin/env bash

## Docker auto-Deployement with Nginx Let's Encrypt support.
## You have too point DNS of your domain to your server, Launch the nginx container
## And finally, you can deploy stack like this :
## $ add_stack.sh --image=wordpress --domain=blog.example.com -e 8111

## Script configuration
##################################################################
pubIP=10.1.1.1
adminMail=<EMAIL>
faddPath=/srv/www
scriptsPath=/srv/scripts
dockerPath=/usr/bin
composePath=/usr/local/bin
logsPath=/path/to/logs

## Catch Args
##################################################################
while test $# -gt 0; do
	case "$1" in
        	-h|--help)
			echo " "
                        echo "Add_Stack.sh -- Create a new Docker deployment"
                        echo " "
                        echo "add_stack.sh [arguments]"
                        echo " "
                        echo "options:"
                        echo "-h, --help                show brief help"
                        echo "-i, --image=IMAGE         specify an image to use"
			echo "-d, --domain=DOMAIN       specify a domain to use"
			echo "-e, --expose=PORT         specify a port to expose the service"
                        exit 0
                        ;;
                -i)
                        shift
                        if test $# -gt 0; then
                                export stackType=$1
                        else
                                echo "no image specified"
                                exit 1
                        fi
                        shift
                        ;;
                --image*)
                        export stackType=`echo $1 | sed -e 's/^[^=]*=//g'`
                        shift
                        ;;
		-d)
                        shift
                        if test $# -gt 0; then
                                export siteName=$1
                        else
                                echo "no domain specified"
                                exit 1
                        fi
                        shift
                        ;;
                --domain*)
                        export siteName=`echo $1 | sed -e 's/^[^=]*=//g'`
                        shift
                        ;;
		-e)
			shift
			if test $# -gt 0; then
				export portWeb=$1
			else
				echo "no port specified"
				exit 1
			fi
			shift
			;;
		--expose*)
			export portWeb=`echo $1 | sed -e 's/^[^=]*=//g'`
			shift
			;;
                *)
                        break
			exit 1
                        ;;
        esac
done

## Make some checks
##################################################################
#set -o errexit
#set -o nounset

### Check args
### Colors
CSI="\033["
CGREEN="${CSI}1;32m"
CRED="${CSI}1;31m"
CEND="${CSI}0m"
echo
logsFile=$(echo "$logsPath"/"$siteName".log)
echo "Let's create `tput bold`$siteName`tput sgr0`..." 2>&1 | tee -a $logsFile
echo
if [ -z $siteName ]; then
	echo -e "       Make some verifications        [${CRED}FAIL${CEND}]"
	echo
	echo "Have you forget a Domain for your stack ? Check --help"
  exit 1
fi
if [ -z $portWeb ]; then
	echo -e "       Make some verifications        [${CRED}FAIL${CEND}]"
	echo
	echo "Have you forget a Port for your stack ? Check --help"
  exit 1
fi
if [ -z $stackType ]; then
	echo -e "       Make some verifications        [${CRED}FAIL${CEND}]"
	echo
	echo "Have you forget an Image for your stack ? Check --help"
  exit 1
fi

{'fraction_non_alphanumeric': 0.15977175463623394, 'fraction_numerical': 0.011697574893009986, 'mean_word_length': 1.2442381562099871, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5407995', 'n_tokens_mistral': 2096, 'n_tokens_neox': 1833, 'n_words': 591}