<commit_before>#!/bin/bash

# Number of repos to create
USERS=1

# Clone xebia-petclinic
git clone <EMAIL>:xebia-france-training/xebia-petclinic

CURRENT_GROUP_ID="<groupId>fr.xebia.demo.petclinic<\/groupId>"

for i in `jot - 1 $USERS`
do

	NEW_GROUP_ID="<groupId>fr.xebia.demo.petclinic-$i<\/groupId>"
	REPOSITORY_NAME="xebia-petclinic-$i"

	# create repository
	# FIXME (CLC) make github user a variable injected by an external file because xebia-continuous-delivery-tech-event can not be owner of the github account
	curl -u 'xebia-continuous-delivery-tech-event:1645faface' http://github.com/api/v2/json/repos/create -F name=$REPOSITORY_NAME

   	# Replace <groupId>fr.xebia.demo.petclinic</groupId> by <groupId>fr.xebia.demo.petclinic-$i</groupId> 	
	cp -rf xebia-petclinic/ $REPOSITORY_NAME
	sed "s/$CURRENT_GROUP_ID/$NEW_GROUP_ID/g" $REPOSITORY_NAME/pom.xml > /tmp/temppom.xml
	mv /tmp/temppom.xml $REPOSITORY_NAME/pom.xml

	# push sources from the cloned repository to the one just created
	cd $REPOSITORY_NAME
	git init
	git add .
	git commit -m "clone xebia-petclinic to $REPOSITORY_NAME"  
	git remote add $REPOSITORY_NAME <EMAIL>:xebia-continuous-delivery-tech-event/$REPOSITORY_NAME.git
	git push -u $REPOSITORY_NAME master
	cd ..	

done<commit_msg>init github repos - workshop continuous delivery<commit_after>#!/bin/bash

# Number of repos to create
USERS=1

# Clone xebia-petclinic
git clone <EMAIL>:xebia-france-training/xebia-petclinic

CURRENT_GROUP_ID="<groupId>fr.xebia.demo.petclinic<\/groupId>"

for i in `jot - 1 $USERS`
do

	NEW_GROUP_ID="<groupId>fr.xebia.demo.petclinic-$i<\/groupId>"
	REPOSITORY_NAME="xebia-petclinic-$i"

	# create repository
	# FIXME (CLC) make github user a variable injected by an external file because xebia-continuous-delivery-tech-event can not be owner of the github account
	curl -u 'xebia-continuous-delivery-tech-event:1645faface' http://github.com/api/v2/json/repos/create -F name=$REPOSITORY_NAME

   	# Replace <groupId>fr.xebia.demo.petclinic</groupId> by <groupId>fr.xebia.demo.petclinic-$i</groupId> 	
	cp -rf xebia-petclinic/ $REPOSITORY_NAME
	sed "s/$CURRENT_GROUP_ID/$NEW_GROUP_ID/g" $REPOSITORY_NAME/pom.xml > /tmp/temppom.xml
	mv /tmp/temppom.xml $REPOSITORY_NAME/pom.xml

	# push sources from the cloned repository to the one just created
	$REPOSITORY_NAME/git init
	$REPOSITORY_NAME/git add .
	$REPOSITORY_NAME/git commit -m "clone xebia-petclinic to $REPOSITORY_NAME"  
	$REPOSITORY_NAME/git remote add $REPOSITORY_NAME git@github.com:xebia-continuous-delivery-tech-event/$REPOSITORY_NAME.git
	$REPOSITORY_NAME/git push -u $REPOSITORY_NAME master

done
{'fraction_non_alphanumeric': 0.11594202898550725, 'fraction_numerical': 0.005339435545385202, 'mean_word_length': 4.841870824053452, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 1, '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': '3614301', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1009, 'n_words': 207}