Commit 323b2c9e authored by Emeric Verschuur's avatar Emeric Verschuur

Set git lfs as an optional feature

parent 5f1fccfa
......@@ -15,6 +15,9 @@ CITBX_DEFAULT_JOB_SHELL="/bin/bash"
# Set service dockers in privileged mode as default
#CITBX_DEFAULT_SERVICE_DOCKER_PRIVILEGED="true"
#
# Enable support of git lfs
#CITBX_GIT_LFS_SUPPORT_ENABLED="true"
#
# Enable git lfs by default
#CITBX_DEFAULT_GIT_LFS_ENABLED="true"
#
......@@ -23,6 +23,8 @@ else
}
fi
INSTALL_PKGS=(docker-ce gawk python-yaml jq)
# remove old versions...
if ubuntu_is_installed docker.io; then
print_note "Removing old docker.io package..."
......@@ -54,17 +56,16 @@ else
stable"
_sudo apt-get update
fi
if grep -qr 'git-lfs' /etc/apt/; then
print_note "GIT LFS apt repository is already present."
else
print_note "Adding GIT LFS apt repository..."
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
if [ "$CITBX_GIT_LFS_SUPPORT_ENABLED" =="true" ]; then
if grep -qr 'git-lfs' /etc/apt/; then
print_note "GIT LFS apt repository is already present."
else
print_note "Adding GIT LFS apt repository..."
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
fi
INSTALL_PKGS+=(git-lfs)
fi
_sudo apt-get -y install docker-ce \
gawk \
python-yaml \
jq \
git-lfs
_sudo apt-get -y install "${INSTALL_PKGS[@]}"
if [ "${USER}" != "root" ]; then
_sudo gpasswd -a ${USER} docker
......
......@@ -183,7 +183,7 @@ done
if [ "$(echo "true" | yaml2json 2>/dev/null)" != "true" ]; then
CITBX_MISSING_PKGS+=("python-yaml")
fi
if ! git lfs version > /dev/null 2>&1; then
if [ "$CITBX_GIT_LFS_SUPPORT_ENABLED" == "true" ] && ! git lfs version > /dev/null 2>&1; then
CITBX_MISSING_PKGS+=("git-lfs")
fi
......@@ -447,8 +447,10 @@ case "$command" in
-d "Git submodule strategy (none, normal or recursive)" -t string -v "${GIT_SUBMODULE_STRATEGY:-none}"
bashopts_declare -n CITBX_GIT_CLEAN -l git-clean -o c \
-d "Perfom a git clean -fdx in the main project and submodules" -t boolean
bashopts_declare -n CITBX_GIT_LFS_ENABLED -l git-lfs -v "$CITBX_DEFAULT_GIT_LFS_ENABLED" \
-d "Enable git LFS support" -t boolean
if [ "$CITBX_GIT_LFS_SUPPORT_ENABLED" == "true" ]; then
bashopts_declare -n CITBX_GIT_LFS_ENABLED -l git-lfs -v "$CITBX_DEFAULT_GIT_LFS_ENABLED" \
-d "Enable git LFS support" -t boolean
fi
declare_opts=()
if [ -n "$DEFAULT_CI_REGISTRY" ]; then
declare_opts+=(-v "$DEFAULT_CI_REGISTRY")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment