<commit_before>#!/bin/bash 

#stop old containers if they ar running
if [ $(docker ps -a -q --filter 'label=environment=slack_weather_integration_test') ]; then
	docker stop $(docker ps -a -q --filter 'label=environment=slack_weather_integration_test')
fi

#build docker container for integration test and run it
docker build --force-rm -t tschaible/slack-weather:integration-test . && \
docker run -e OPENWEATHERMAP_API_KEY=$OPENWEATHERMAP_API_KEY -d \
	-p 6789:3000 --label environment=slack_weather_integration_test tschaible/slack-weather:integration-test 

#wait for server to come up, up to 20s
RETRY=0
until [ "$RETRY" -gt 3 ] || $(curl --output /dev/null --silent --head http://$DOCKER_HOST_ADDRESS:6789); do 
	RETRY=$(($RETRY + 1))
	sleep 5
	printf '.'
done;<commit_msg>default docker host for integration tes to 127.0.0.1 #5<commit_after>#!/bin/bash 

#stop old containers if they ar running
if [ $(docker ps -a -q --filter 'label=environment=slack_weather_integration_test') ]; then
	docker stop $(docker ps -a -q --filter 'label=environment=slack_weather_integration_test')
fi

if [ -z "$DOCKER_HOST_ADDRESS" ]; then
	DOCKER_HOST_ADDRESS="127.0.0.1"
fi

#build docker container for integration test and run it
docker build --force-rm -t tschaible/slack-weather:integration-test . && \
docker run -e OPENWEATHERMAP_API_KEY=$OPENWEATHERMAP_API_KEY -d \
	-p 6789:3000 --label environment=slack_weather_integration_test tschaible/slack-weather:integration-test 

#wait for server to come up, up to 20s
RETRY=0
until [ "$RETRY" -gt 3 ] || $(curl --output /dev/null --silent --head http://$DOCKER_HOST_ADDRESS:6789); do 
	RETRY=$(($RETRY + 1))
	sleep 5
	printf '.'
done;
{'fraction_non_alphanumeric': 0.12947494033412887, 'fraction_numerical': 0.029236276849642005, 'mean_word_length': 4.59, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3374463', 'n_tokens_mistral': 650, 'n_tokens_neox': 568, 'n_words': 165}