<commit_before>#!/usr/local/bin/dumb-init /bin/bash

function extend_list {
    python -c "import sys ; first = set(sys.argv[1].split(',')) ; all = first.union(set(sys.argv[2:])) ; print ','.join(all)" $@
}

source /opt/qnib/consul/etc/bash_functions.sh
wait_for_srv gocd-server

if [ "X${GOCD_LOCAL_DOCKERENGINE}" == "Xtrue" ];then
	GOCD_AGENT_AUTOENABLE_RESOURCES=$(extend_list ${GOCD_AGENT_AUTOENABLE_RESOURCES} docker-engine)
fi

consul-template -once -template "/etc/consul-templates/gocd/autoregister.properties.ctmpl:/opt/go-agent/config/autoregister.properties"

/opt/go-agent/agent.sh 2>&1 1>/var/log/gocd-agent.log &
echo $$ > /opt/go-agent/go-agent.pid
tail -f /var/log/gocd-agent.log<commit_msg>allow to skip consul-check<commit_after>#!/usr/local/bin/dumb-init /bin/bash

function extend_list {
    python -c "import sys ; first = set(sys.argv[1].split(',')) ; all = first.union(set(sys.argv[2:])) ; print ','.join(all)" $@
}

if [ "X${GOCD_SKIP_WAIT}" != "Xtrue" ];then
    source /opt/qnib/consul/etc/bash_functions.sh
    wait_for_srv gocd-server
fi

if [ "X${GOCD_LOCAL_DOCKERENGINE}" == "Xtrue" ];then
	GOCD_AGENT_AUTOENABLE_RESOURCES=$(extend_list ${GOCD_AGENT_AUTOENABLE_RESOURCES} docker-engine)
fi

consul-template -once -template "/etc/consul-templates/gocd/autoregister.properties.ctmpl:/opt/go-agent/config/autoregister.properties"

/opt/go-agent/agent.sh 2>&1 1>/var/log/gocd-agent.log &
echo $$ > /opt/go-agent/go-agent.pid
tail -f /var/log/gocd-agent.log
{'fraction_non_alphanumeric': 0.1774628879892038, 'fraction_numerical': 0.006747638326585695, 'mean_word_length': 4.748062015503876, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5086878', 'n_tokens_mistral': 630, 'n_tokens_neox': 606, 'n_words': 83}