#!/bin/bash
set -x
git config --get user.email
if [ $? -ne 0 ]; then
	mkdir output
	git config --global user.email "you@example.com"
	git config --global user.name "Your Name"
	git remote add origin https://github.com/yuji-k64613/maven_sample.git
	git branch master
	cat << EOF >> ~/.netrc
machine github.com
login yuji-k64613
password addhl,dE0
EOF
fi
set -e
(
	cd /tmp
	rm -fr workspace
	git clone https://github.com/yuji-k64613/workspace.git
)
#git checkout master
#cp -p target/sample.war output/
#git add output/sample.war
#git commit -m "$(date)"
#git push origin master
cp -p target/sample.war /tmp/workspace/
(
	cd /tmp/workspace
	git add sample.war
	git commit -m "$(date)"
	git push origin master
)
