nextcloud/.devcontainer/setup.sh
Robin Windey 9dd158b70d
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>
2023-10-13 16:18:57 +00:00

30 lines
835 B
Bash
Executable File

#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" >/dev/null 2>&1 && pwd )"
cd $DIR/
git submodule update --init
# Codespace config
cp .devcontainer/codespace.config.php config/codespace.config.php
# VSCode debugger profile
mkdir -p .vscode && cp .devcontainer/launch.json .vscode/launch.json
# Onetime installation setup
if [[ ! $(sudo -u ${APACHE_RUN_USER} php occ status) =~ installed:[[:space:]]*true ]]; then
echo "Running NC installation"
sudo -u ${APACHE_RUN_USER} php occ maintenance:install \
--verbose \
--database=pgsql \
--database-name=postgres \
--database-host=127.0.0.1 \
--database-port=5432 \
--database-user=postgres \
--database-pass=postgres \
--admin-user admin \
--admin-pass admin
fi
sudo service apache2 restart