#!/usr/bin/env bash # $1 git url # $2 artifact path # $3 save dir # $4 build name # $5 source dir # $3 comment GitUrl=$1 ArtifactPath=$2 SaveDir=$3 BuildName=$4 SourcePath=$5 Comment=$6 RepoDir=$(dirname ${ArtifactPath}) RepoPath="${RepoDir}/repo/${BuildName}/${SaveDir}" ScriptDir=$(dirname ${SourcePath}) cd ${RepoPath} pwd echo $SourcePath echo $RepoPath echo $ScriptDir echo "clean old:" ls -A | grep -v '.git' | xargs rm -rf {} echo "copy new:" cp -R ${SourcePath}/src/. . #cp -R ${SourcePath}/app_data . #cp -R ${SourcePath}/bin . #cp -R ${SourcePath}/ini . #cp -R ${SourcePath}/PostDeploymentActions . git add -f . git commit -a -m "TFS:${Comment}" git push -u origin --all