ContainerImage.GitSparseClone/init/entrypoint.sh

17 lines
386 B
Bash
Raw Normal View History

2020-02-17 12:40:01 +00:00
#!/bin/sh
2020-02-17 14:12:18 +00:00
# Configure git for corporate proxy
git config --global http.proxyAuthMethod basic
2020-02-17 12:40:01 +00:00
# Clone git-repo
git init
git config core.sparsecheckout true
echo $SPARSE_CHECKOUT >> .git/info/sparse-checkout
git remote add -f origin $REMOTE_REPO
git pull origin $REMOTE_BRANCH
2020-02-17 12:53:54 +00:00
# Create target folder and move files
mkdir -p $TARGET_DIR
2020-02-17 15:16:26 +00:00
mv `echo $SPARSE_CHECKOUT` $TARGET_DIR
2020-02-17 12:40:01 +00:00
exec "$@"