<commit_before>#!/usr/bin/env bash
set -e

function fatal() {
	echo -e "\033[31m$*\033[0m"
}

function info() {
	echo -e "\033[32m$*\033[0m"
}

[ ! -e target -o ! -d target ] && {
	fatal "Target is not exist or is not a folder."
	exit -1
}

finalName=`mvn help:evaluate -Dexpression=project.build.finalName 2>/dev/null|grep -v "^.*\s.*$"`

[ $? -ne 0 ] && {
	fatal "Cannot retrieve the final name for this artifact."
	exit -1
}

[ ! -e target/$finalName.war ] && {
	fatal "Not a valid hsf application."
	exit -1
}

#/d/source/directory
local_wd=$PWD/target/$finalName.war
#\\d\\source\\directory
local_wd=${local_wd//\//\\}
local_wd=${local_wd#\\}
local_wd=${local_wd/\\/:}

docker run --name=edas-${PWD##*/} -d -p $1:5005 -v $local_wd:/opt/taobao-tomcat-7.0.59/deploy/$finalName.war  --add-host=jmenv.tbsite.net:$2 --add-host=config.tesir.top:192.168.103.101  index.tenxcloud.com/revolc/edas:latest<commit_msg>use internal docker image<commit_after>#!/usr/bin/env bash
set -e

function fatal() {
	echo -e "\033[31m$*\033[0m"
}

function info() {
	echo -e "\033[32m$*\033[0m"
}

[ ! -e target -o ! -d target ] && {
	fatal "Target is not exist or is not a folder."
	exit -1
}

finalName=`mvn help:evaluate -Dexpression=project.build.finalName 2>/dev/null|grep -v "^.*\s.*$"`

[ $? -ne 0 ] && {
	fatal "Cannot retrieve the final name for this artifact."
	exit -1
}

[ ! -e target/$finalName.war ] && {
	fatal "Not a valid hsf application."
	exit -1
}

[ ! -e target/deploy ] && mkdir target/deploy
[ ! -e target/deploy/$finalName.war ] && cp target/$finalName.war target/deploy/$finalName.war

container=edas-${PWD##*/}

count=`docker ps -f name=$container|wc -l`

[ $count -eq 2 ] && docker stop $container

count=`docker ps -af name=$container|wc -l`

[ $count -eq 2 ] && docker rm $container

#/d/source/directory
local_wd=$PWD/target/deploy
#\\d\\source\\directory
local_wd=${local_wd//\//\\}
local_wd=${local_wd#\\}
local_wd=${local_wd/\\/:\\}

info "${local_wd//\\/\\\\}"

docker run --name=$container -d -p $1:5005 -p ${3:-8080}:8080 -v $local_wd:/home/tomcat/deploy -e JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=0.0.0.0:5005,suspend=n,server=y" --add-host=jmenv.tbsite.net:$2 --add-host=config.tesir.top:192.168.103.101  docker.tesir.top/ci/taobao-tomcat:v1.1
{'fraction_non_alphanumeric': 0.21105748135146996, 'fraction_numerical': 0.04695041684949539, 'mean_word_length': 3.479371316306483, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, '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': '1813884', 'n_tokens_mistral': 1020, 'n_tokens_neox': 926, 'n_words': 197}