<commit_before>#! /bin/bash

#======================================================================================
#  Launch entire docker stack on a remote server
#======================================================================================

path=$HOME'/deployedByJenkins'
server_host=$1
registry='talend-registry:5000'
user=$2

# TODO: improve following to support ipv6
IP_ADDRESS_REGEX='[0-9\.]*'

# Creates our folder on remote:
ssh $user@$server_host mkdir $path --parent

# Change TDP_API_HOST in fig file with host IP:
sed "s|TDP_API_HOST: "$IP_ADDRESS_REGEX"|TDP_API_HOST: "$server_host"|g" ../dataprep-platform/src/main/resources/fig_backend_data_web.yml > /tmp/fig_custom.yml

# Add registry prefix for our images:
cp /tmp/fig_custom.yml /tmp/fig_custom_1.yml
from='image: talend/'
to='image: '$registry'/talend/'
sed "s|$from|$to|g" /tmp/fig_custom_1.yml > /tmp/fig_custom.yml

# Copy custom fig file to remote:
scp /tmp/fig_custom.yml $user@$server_host:$path

ssh $user@$server_host fig -f $path'/fig_custom.yml' pull --allow-insecure-ssl
ssh $user@$server_host 'bash -s' < ../dataprep-platform/src/main/resources/clean.sh
ssh $user@$server_host 'fig -p tdp -f '$path'/fig_custom.yml up --allow-insecure-ssl > '$path'/fig.log &'
<commit_msg>Tooling: fix bug in deployOnRemote.sh<commit_after>#! /bin/bash

#======================================================================================
#  Launch entire docker stack on a remote server
#======================================================================================

server_host=$1
registry='talend-registry:5000'
username=$2
path='/home/'$username'/deployedByJenkins'

# TODO: improve following to support ipv6
IP_ADDRESS_REGEX='[0-9\.]*'

# Creates our folder on remote:
ssh $username@$server_host mkdir $path --parent

# Change TDP_API_HOST in fig file with host IP:
sed "s|TDP_API_HOST: "$IP_ADDRESS_REGEX"|TDP_API_HOST: "$server_host"|g" ../dataprep-platform/src/main/resources/fig_backend_data_web.yml > /tmp/fig_custom.yml

# Add registry prefix for our images:
cp /tmp/fig_custom.yml /tmp/fig_custom_1.yml
from='image: talend/'
to='image: '$registry'/talend/'
sed "s|$from|$to|g" /tmp/fig_custom_1.yml > /tmp/fig_custom.yml

# Copy custom fig file to remote:
scp /tmp/fig_custom.yml $username@$server_host:$path

#ssh $username@$server_host fig -f $path'/fig_custom.yml' pull --allow-insecure-ssl
#ssh $username@$server_host 'bash -s' < ../dataprep-platform/src/main/resources/clean.sh
#ssh $username@$server_host 'fig -p tdp -f '$path'/fig_custom.yml up --allow-insecure-ssl > '$path'/fig.log &'

{'fraction_non_alphanumeric': 0.26628131021194607, 'fraction_numerical': 0.008477842003853564, 'mean_word_length': 6.0162162162162165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '2612718', 'n_tokens_mistral': 930, 'n_tokens_neox': 843, 'n_words': 190}