Skip to content
Snippets Groups Projects
Verified Commit a751255e authored by Olivier Benz's avatar Olivier Benz
Browse files

Merge branch 'develop'

parents 83662875 725bd1b0
No related branches found
No related tags found
No related merge requests found
Pipeline #11089 passed
liberapay: benz0li
custom: ['https://benz0li.b-data.io/donate?project=4']
...@@ -36,8 +36,7 @@ build:version-linux-amd64: ...@@ -36,8 +36,7 @@ build:version-linux-amd64:
--build-arg GIT_LFS_VERSION --build-arg GIT_LFS_VERSION
-t $CI_APP_REPO:$GIT_LFS_VERSION-linux-amd64 -t $CI_APP_REPO:$GIT_LFS_VERSION-linux-amd64
-f build.Dockerfile . -f build.Dockerfile .
- | - docker push $CI_APP_REPO:$GIT_LFS_VERSION-linux-amd64
docker push $CI_APP_REPO:$GIT_LFS_VERSION-linux-amd64
rules: rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_BUILD_PLATFORMS =~ /(linux\/amd64)/ - if: $CI_COMMIT_BRANCH == "main" && $CI_BUILD_PLATFORMS =~ /(linux\/amd64)/
changes: changes:
...@@ -56,8 +55,7 @@ build:version-linux-arm64v8: ...@@ -56,8 +55,7 @@ build:version-linux-arm64v8:
--build-arg GIT_LFS_VERSION --build-arg GIT_LFS_VERSION
-t $CI_APP_REPO:$GIT_LFS_VERSION-linux-arm64v8 -t $CI_APP_REPO:$GIT_LFS_VERSION-linux-arm64v8
-f build.Dockerfile . -f build.Dockerfile .
- | - docker push $CI_APP_REPO:$GIT_LFS_VERSION-linux-arm64v8
docker push $CI_APP_REPO:$GIT_LFS_VERSION-linux-arm64v8
rules: rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_BUILD_PLATFORMS =~ /(linux\/arm64\/v8)/ - if: $CI_COMMIT_BRANCH == "main" && $CI_BUILD_PLATFORMS =~ /(linux\/arm64\/v8)/
changes: changes:
......
[![minimal-readme compliant](https://img.shields.io/badge/readme%20style-minimal-brightgreen.svg)](https://github.com/RichardLitt/standard-readme/blob/master/example-readmes/minimal-readme.md) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) <a href="https://benz0li.b-data.io/donate?project=4"><img src="https://benz0li.b-data.io/donate/static/donate-with-fosspay.png" alt="Donate with fosspay"></a> <a href="https://liberapay.com/benz0li/donate"><img src="https://liberapay.com/assets/widgets/donate.svg" alt="Donate using Liberapay" height="20"></a> [![minimal-readme compliant](https://img.shields.io/badge/readme%20style-minimal-brightgreen.svg)](https://github.com/RichardLitt/standard-readme/blob/master/example-readmes/minimal-readme.md) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) <a href="https://benz0li.b-data.io/donate?project=4"><img src="https://benz0li.b-data.io/donate/static/donate-with-fosspay.png" alt="Donate with fosspay"></a> <a href="https://liberapay.com/benz0li/donate"><img src="https://liberapay.com/assets/widgets/donate.svg" alt="Donate using Liberapay" height="20"></a>
# Git LFS install # Dockerised Git LFS installation
[This project](https://gitlab.com/b-data/git-lfs/glfsi) is intended for system [This project](https://gitlab.com/b-data/git-lfs/glfsi) is intended for system
administrators who want to perform an installation of Git LFS on any Linux administrators who want to perform an installation of Git LFS on any Linux
...@@ -23,11 +23,11 @@ This projects requires an installation of docker and docker compose. ...@@ -23,11 +23,11 @@ This projects requires an installation of docker and docker compose.
To install docker, follow the instructions for your platform: To install docker, follow the instructions for your platform:
* [Install Docker Engine | Docker Documentation > Supported platforms](https://docs.docker.com/engine/install/#supported-platforms) * [Install Docker Engine | Docker Documentation > Supported platforms](https://docs.docker.com/engine/install/#supported-platforms)
* [Post-installation steps for Linux](https://docs.docker.com/engine/install/linux-postinstall/) * [Post-installation steps for Linux | Docker Documentation](https://docs.docker.com/engine/install/linux-postinstall/)
### Docker Compose ### Docker Compose
* [Install Docker Compose](https://docs.docker.com/compose/install/) * [Install Docker Compose | Docker Documentation](https://docs.docker.com/compose/install/)
## Install ## Install
......
...@@ -4,7 +4,8 @@ IMAGE=debian:bullseye ...@@ -4,7 +4,8 @@ IMAGE=debian:bullseye
GIT_LFS_VERSION=3.2.0 GIT_LFS_VERSION=3.2.0
# Installation prefix # Installation prefix
PREFIX=/usr/local # default: /usr/local
PREFIX=
# Execution mode (default: install) # Execution mode (default: install)
# other: uninstall # other: uninstall
......
...@@ -9,10 +9,11 @@ services: ...@@ -9,10 +9,11 @@ services:
image: glfsi image: glfsi
container_name: glfsi container_name: glfsi
network_mode: host network_mode: host
userns_mode: host
volumes: volumes:
- ${PREFIX}:${PREFIX} - ${PREFIX:-/usr/local}:${PREFIX:-/usr/local}
- /etc:/tmp/etc
environment: environment:
- GIT_LFS_VERSION=${GIT_LFS_VERSION} - GIT_LFS_VERSION=${GIT_LFS_VERSION}
- PREFIX=${PREFIX} - PREFIX=${PREFIX:-/usr/local}
- MODE=${MODE:-install} - MODE=${MODE:-install}
userns_mode: host
...@@ -4,27 +4,64 @@ ...@@ -4,27 +4,64 @@
set -e set -e
# Test if PREFIX location is whithin limits
if [[ ! "${PREFIX}" == "/usr/local" && ! "${PREFIX}" =~ ^"/opt" ]]; then
echo "ERROR: PREFIX set to '${PREFIX}'. Must either be '/usr/local' or within '/opt'."
exit 1
fi
cd /tmp cd /tmp
curl -sSLO https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-$(dpkg --print-architecture)-v${GIT_LFS_VERSION}.tar.gz curl -sSLO https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-$(dpkg --print-architecture)-v${GIT_LFS_VERSION}.tar.gz
tar xfz git-lfs-linux-$(dpkg --print-architecture)-v${GIT_LFS_VERSION}.tar.gz --no-same-owner if [[ ${GIT_LFS_VERSION//./} -ge 320 ]]; then
cd git-lfs-${GIT_LFS_VERSION} tar xfz git-lfs-linux-$(dpkg --print-architecture)-v${GIT_LFS_VERSION}.tar.gz --no-same-owner
cd git-lfs-${GIT_LFS_VERSION}
else
tar xfz git-lfs-linux-$(dpkg --print-architecture)-v${GIT_LFS_VERSION}.tar.gz --no-same-owner --one-top-level
cd git-lfs-linux-$(dpkg --print-architecture)-v${GIT_LFS_VERSION}
fi
sed -i 's/git lfs install/#git lfs install/g' install.sh sed -i 's/git lfs install/#git lfs install/g' install.sh
echo ' echo '
mkdir -p $prefix/share/man/man1 # According to https://www.debian.org/doc/debian-policy/ch-opersys.html#site-specific-programs
if [[ "$PREFIX" == "/usr/local" && -e /tmp/etc/staff-group-for-usr-local ]]; then
perm=2775
group=staff
else
perm=755
group=root
fi
mkdir -p $prefix/share
mkdir -m$perm -p $prefix/share/man
chown root:$group $prefix/share/man
mkdir -m$perm -p $prefix/share/man/man1
chown root:$group $prefix/share/man/man1
rm -rf $prefix/share/man/man1/git-lfs* rm -rf $prefix/share/man/man1/git-lfs*
pushd "$( dirname "${BASH_SOURCE[0]}" )/man/man1" > /dev/null if [[ -d man/man1 ]]; then
for g in git-lfs*; do suffix=/man1
else
suffix=
fi
pushd "$( dirname "${BASH_SOURCE[0]}" )/man$suffix" > /dev/null
for g in *.1; do
install -m0644 $g "$prefix/share/man/man1/$g" install -m0644 $g "$prefix/share/man/man1/$g"
done done
popd > /dev/null popd > /dev/null
mkdir -p $prefix/share/man/man5 mkdir -m$perm -p $prefix/share/man/man5
chown root:$group $prefix/share/man/man5
rm -rf $prefix/share/man/man5/git-lfs* rm -rf $prefix/share/man/man5/git-lfs*
pushd "$( dirname "${BASH_SOURCE[0]}" )/man/man5" > /dev/null if [[ -d man/man5 ]]; then
for g in git-lfs*; do suffix=/man5
else
suffix=
fi
pushd "$( dirname "${BASH_SOURCE[0]}" )/man$suffix" > /dev/null
for g in *.5; do
install -m0644 $g "$prefix/share/man/man5/$g" install -m0644 $g "$prefix/share/man/man5/$g"
done done
popd > /dev/null' >> install.sh popd > /dev/null' >> install.sh
...@@ -34,20 +71,23 @@ set -eu ...@@ -34,20 +71,23 @@ set -eu
prefix="/usr/local" prefix="/usr/local"
if [ "${PREFIX:-}" != "" ] ; then if [[ "${PREFIX:-}" != "" ]] ; then
prefix=${PREFIX:-} prefix=${PREFIX:-}
elif [ "${BOXEN_HOME:-}" != "" ] ; then elif [[ "${BOXEN_HOME:-}" != "" ]] ; then
prefix=${BOXEN_HOME:-} prefix=${BOXEN_HOME:-}
fi fi
rm -rf $prefix/bin/git-lfs* rm -rf $prefix/bin/git-lfs*
rm -rf $prefix/share/man/man1/git-lfs* rm -rf $prefix/share/man/man1/git-lfs*
rm -rf $prefix/share/man/man5/git-lfs*' > uninstall.sh rm -rf $prefix/share/man/man5/git-lfs*
rmdir $prefix/share/man/man1 2>&1 | sed "s|^|INFO: |"
rmdir $prefix/share/man/man5 2>&1 | sed "s|^|INFO: |"' > uninstall.sh
chmod +x uninstall.sh chmod +x uninstall.sh
if [[ -f "${MODE}.sh" ]]; then if [[ -f "${MODE}.sh" ]]; then
./${MODE}.sh ./${MODE}.sh
echo "Git LFS at ${PREFIX} ${MODE}ed." echo "INFO: Git LFS v${GIT_LFS_VERSION} at ${PREFIX} ${MODE}ed."
else else
echo "Execution mode '${MODE}' not supported!" echo "ERROR: Execution mode '${MODE}' not supported!"
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment