Swift: use git-lfs devcontainer feature

This commit is contained in:
Paolo Tranquilli
2024-07-16 11:24:01 +02:00
parent 1dbe908024
commit bd1f548fbc
3 changed files with 26 additions and 38 deletions

View File

@@ -1,25 +1,28 @@
{
"extensions": [
"github.vscode-codeql",
"hbenl.vscode-test-explorer",
"ms-vscode.test-adapter-converter",
"slevesque.vscode-zipexplorer",
"ms-vscode.cpptools"
],
"settings": {
"files.watcherExclude": {
"**/target/**": true
},
"codeQL.runningQueries.memory": 2048
},
"build": {
"dockerfile": "Dockerfile",
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"remoteUser": "vscode",
"onCreateCommand": ".devcontainer/swift/user.sh"
"extensions": [
"github.vscode-codeql",
"hbenl.vscode-test-explorer",
"ms-vscode.test-adapter-converter",
"slevesque.vscode-zipexplorer",
"ms-vscode.cpptools"
],
"features": {
"git-lfs": "latest"
},
"settings": {
"files.watcherExclude": {
"**/target/**": true
},
"codeQL.runningQueries.memory": 2048
},
"build": {
"dockerfile": "Dockerfile",
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"remoteUser": "vscode",
"onCreateCommand": ".devcontainer/swift/user.sh"
}

View File

@@ -3,9 +3,6 @@ set -xe
BAZELISK_VERSION=v1.12.0
BAZELISK_DOWNLOAD_SHA=6b0bcb2ea15bca16fffabe6fda75803440375354c085480fe361d2cbf32501db
# install git lfs apt source
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
# install gh apt source
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
@@ -21,7 +18,6 @@ apt-get -y install --no-install-recommends \
python3-distutils \
python3-pip \
bash-completion \
git-lfs \
gh
# Install Bazel

View File

@@ -1,16 +1,5 @@
set -xe
# git lfs install may fail because codespaces can install its own hooks
# let's install it manually
for script in pre-push post-checkout post-commit post-merge; do
if [ -x .git/hooks/$script ]; then
sed -i "2i git lfs $script || exit 1" .git/hooks/$script
else
printf "#!/bin/bash\ngit lfs %s\n" $script > .git/hooks/$script
chmod +x .git/hooks/$script
fi
done
# add the workspace to the codeql search path
mkdir -p /home/vscode/.config/codeql
echo "--search-path /workspaces/codeql" > /home/vscode/.config/codeql/config