-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b32063a
commit d88e278
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test | ||
main | ||
main.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env sh | ||
|
||
# This file takes as an argument the .envrc file where variables are defined. | ||
if [ -z "$1" ] | ||
then | ||
echo "Please provide the path to the .envrc file" | ||
exit 1 | ||
fi | ||
|
||
ENVRC="$1" | ||
|
||
# Use a variant of the program to see input and output to the program. | ||
go build main.go | ||
echo -e "#!/usr/bin/env sh\n\ntee -a ../input.log | ../../main | tee -a ../output.log >&1\n" > main.sh | ||
chmod +x main.sh | ||
|
||
rm -rf test | ||
mkdir test | ||
cd test && ( | ||
mkdir fake-remote-repo && cd fake-remote-repo | ||
git init --bare | ||
cd .. | ||
git clone --progress fake-remote-repo local-repo &&\ | ||
cd local-repo && ( | ||
git lfs install --local | ||
git lfs track "*.bin" | ||
git add .gitattributes | ||
git config --add lfs.customtransfer.lfs-s3.path ../../main.sh | ||
git config --add lfs.standalonetransferagent lfs-s3 | ||
git commit -m "Adding .gitattributes" | ||
echo "# This is a lfs-s3 test." > README.md | ||
dd if=/dev/urandom of=1mb-blob.bin bs=1024 count=1024 | ||
git add README.md 1mb-blob.bin | ||
git commit -m "Adding files" | ||
source "$ENVRC" | ||
GIT_TRACE=1 git push origin master | ||
git remote -v | ||
) && cd .. | ||
git clone --progress fake-remote-repo local-repo-dup &&\ | ||
cd local-repo-dup && ( | ||
git lfs install --local | ||
git config --add lfs.customtransfer.lfs-s3.path ../../main.sh | ||
git config --add lfs.standalonetransferagent lfs-s3 | ||
source "$ENVRC" | ||
git reset --hard master | ||
git lfs pull | ||
) | ||
) |