From 32d2104036d5bbef313e048014ccda0cb90ce59f Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Thu, 14 Nov 2024 06:04:56 +0000 Subject: [PATCH 1/3] fix(devcontainer): create mapped config dirs in image --- .devcontainer/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b68b025..8262cdb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,8 +9,9 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ RUN useradd --create-home --shell /bin/bash $USER USER $USER -ENV PATH "$PATH:/home/$USER/.local/bin" -WORKDIR /home/$USER/admin +ENV PATH="$PATH:/home/$USER/.local/bin" +RUN mkdir -p /home/$USER/.config/compiler-admin +WORKDIR /home/$USER/compiler-admin RUN python -m pip install --upgrade pip @@ -20,7 +21,7 @@ COPY pyproject.toml pyproject.toml RUN pip install -e .[dev,test] USER root -RUN chown -R $USER /home/$USER +RUN chown -R $USER:$USER /home/$USER USER $USER CMD ["sleep", "infinity"] From 616f88ff70bd878adfc9742eba96819b5eede683 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 19 Nov 2024 18:46:05 +0000 Subject: [PATCH 2/3] chore: remove local .config dir moved out of repo --- .config/README.md | 6 ------ .devcontainer/devcontainer.json | 2 +- .devcontainer/postAttach.sh | 2 +- .gitignore | 1 - README.md | 2 ++ compose.yaml | 4 ++-- 6 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 .config/README.md diff --git a/.config/README.md b/.config/README.md deleted file mode 100644 index 1400d70..0000000 --- a/.config/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# `.config` directory - -This directory is where local GAM and GYB configuration is stored. - -The directoy's contents (except for this README) are ignored in `.gitignore` to -avoid committing sensitive information. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1402349..5104125 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "name": "compilerla/admin", "dockerComposeFile": ["../compose.yaml"], "service": "dev", - "workspaceFolder": "/home/compiler/admin", + "workspaceFolder": "/home/compiler/compiler-admin", "postAttachCommand": ["/bin/bash", ".devcontainer/postAttach.sh"], "customizations": { "vscode": { diff --git a/.devcontainer/postAttach.sh b/.devcontainer/postAttach.sh index 83421d7..78eb439 100644 --- a/.devcontainer/postAttach.sh +++ b/.devcontainer/postAttach.sh @@ -3,4 +3,4 @@ set -eu pre-commit install --install-hooks -echo -e "\nexport PATH=$PATH:/home/compiler/admin/.config/gyb" >> ~/.bashrc +echo -e "\nexport PATH=$PATH:/home/$USER/.config/compiler-admin/gyb" >> ~/.bashrc diff --git a/.gitignore b/.gitignore index 7408caa..3838572 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ GYB-GMail-Backup-*/ __pycache__ .config/* -!.config/README.md .coverage .downloads .env diff --git a/README.md b/README.md index 8b7929c..7e76800 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ options: ## Getting started ```bash +mkdir -p ~/.config/compiler-admin + git clone https://github.com/compilerla/compiler-admin.git cd compiler-admin diff --git a/compose.yaml b/compose.yaml index bd3cf83..cffc641 100644 --- a/compose.yaml +++ b/compose.yaml @@ -8,6 +8,6 @@ services: - .env entrypoint: sleep infinity volumes: - - .:/home/compiler/admin - - ./.config:/home/compiler/.config/compiler-admin + - .:/home/compiler/compiler-admin + - ~/.config/compiler-admin:/home/compiler/.config/compiler-admin - ./.downloads:/home/compiler/Downloads From 4513f68041997b65ee47a23a7802c5788b1874de Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Tue, 19 Nov 2024 20:56:57 +0000 Subject: [PATCH 3/3] chore(devcontainer): move gyb env to Dockerfile --- .devcontainer/Dockerfile | 2 +- .devcontainer/postAttach.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8262cdb..9386c09 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,8 +9,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ RUN useradd --create-home --shell /bin/bash $USER USER $USER -ENV PATH="$PATH:/home/$USER/.local/bin" RUN mkdir -p /home/$USER/.config/compiler-admin +ENV PATH="$PATH:/home/$USER/.local/bin:/home/$USER/.config/compiler-admin/gyb" WORKDIR /home/$USER/compiler-admin RUN python -m pip install --upgrade pip diff --git a/.devcontainer/postAttach.sh b/.devcontainer/postAttach.sh index 78eb439..fd2e080 100644 --- a/.devcontainer/postAttach.sh +++ b/.devcontainer/postAttach.sh @@ -2,5 +2,3 @@ set -eu pre-commit install --install-hooks - -echo -e "\nexport PATH=$PATH:/home/$USER/.config/compiler-admin/gyb" >> ~/.bashrc