Browse Source

Devcontainer: move git setup to postStartCommand

* postCreateCommand is executed too early
* If git config commands run in postCreate, a global .gitconfig will be created
* Copy of local .gitconfig will be skipped if .gitconfig already exists in container
* Move to later stage
* https://github.com/devcontainers/cli/issues/98
* https://github.com/microsoft/vscode-remote-release/issues/4855#issuecomment-831920085

Signed-off-by: GitHub <noreply@github.com>
tags/v28.0.0beta1
Robin Windey 8 months ago
parent
commit
9dd158b70d
No account linked to committer's email address
3 changed files with 6 additions and 4 deletions
  1. 1
    0
      .devcontainer/devcontainer.json
  2. 5
    0
      .devcontainer/postStart.sh
  3. 0
    4
      .devcontainer/setup.sh

+ 1
- 0
.devcontainer/devcontainer.json View File

@@ -3,6 +3,7 @@
"dockerComposeFile": "docker-compose.yml",
"service": "nextclouddev",
"postCreateCommand": ".devcontainer/setup.sh",
"postStartCommand": ".devcontainer/postStart.sh",
"forwardPorts": [
80,
8080,

+ 5
- 0
.devcontainer/postStart.sh View File

@@ -0,0 +1,5 @@
#!/bin/bash

# Set git safe.directory
git config --global --add safe.directory /var/www/html
git config --global --add safe.directory /var/www/html/3rdparty

+ 0
- 4
.devcontainer/setup.sh View File

@@ -3,10 +3,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" >/dev/null 2>&1 && pwd )"

cd $DIR/

# Set git safe.directory
git config --global --add safe.directory /var/www/html
git config --global --add safe.directory /var/www/html/3rdparty

git submodule update --init

# Codespace config

Loading…
Cancel
Save