Skip to content

Instantly share code, notes, and snippets.

@seunboy1
Last active June 25, 2021 15:22
Show Gist options
  • Save seunboy1/f0d2ed76cabee865eeca7a9a6042b59e to your computer and use it in GitHub Desktop.
Save seunboy1/f0d2ed76cabee865eeca7a9a6042b59e to your computer and use it in GitHub Desktop.
#!/bin/bash
# Version TF record saved on s3
dvc_track_files() {
git init
#initialise dvc in a git directory
dvc init
# helps to prevent duplication by creating an hash of the data in remote
dvc remote add s3cache s3://mybucket/cache
dvc config cache.s3 s3cache
# start tracking a file or directory with dvc
dvc add --external s3://mybucket/existing-data
# add, commit and push file to snapshot
git add existing-data.dvc
TAG="V2"
git commit -m "Data ${TAG}"
git tag ${TAG}
echo "Successfully updated data!!!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment