ContainerImage.GitSparseClone/init/entrypoint.sh

17 lines
425 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
2020-02-18 10:29:25 +00:00
echo "$SPARSE_CHECKOUT" >> .git/info/sparse-checkout
2020-02-17 12:40:01 +00:00
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-18 10:29:25 +00:00
mv `echo "$SPARSE_CHECKOUT" | awk '{gsub(/\/\*$/, ""); print}'` $TARGET_DIR
2020-02-17 12:40:01 +00:00
exec "$@"