mirror of
https://github.com/ublue-os/forge.git
synced 2025-04-25 07:53:43 +03:00
chore(devcontainer): add tools for ansible development
This commit is contained in:
parent
5b5fbd6a56
commit
1fa6f52077
|
@ -4,7 +4,6 @@
|
||||||
"name": "ublue-os/forge",
|
"name": "ublue-os/forge",
|
||||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||||
"image": "mcr.microsoft.com/devcontainers/base:alpine-3.17",
|
"image": "mcr.microsoft.com/devcontainers/base:alpine-3.17",
|
||||||
|
|
||||||
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||||
"remoteUser": "vscode",
|
"remoteUser": "vscode",
|
||||||
// podman needs this
|
// podman needs this
|
||||||
|
@ -15,14 +14,19 @@
|
||||||
// disable selinux isolation that breaks bind mounts
|
// disable selinux isolation that breaks bind mounts
|
||||||
"--security-opt=label=disable"
|
"--security-opt=label=disable"
|
||||||
],
|
],
|
||||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
// Configure environment variables
|
||||||
// "features": {},
|
"containerEnv": {
|
||||||
|
"POETRY_VIRTUALENVS_CREATE": "false",
|
||||||
|
"POETRY_VERSION": "1.3.1"
|
||||||
|
},
|
||||||
|
"remoteEnv": {
|
||||||
|
// Add path for packages installed with poetry
|
||||||
|
"PATH": "${containerEnv:PATH}:/home/vscode/.local/bin:/home/vscode/.local/pipx/venvs/poetry/bin"
|
||||||
|
},
|
||||||
// Mounts from host system
|
// Mounts from host system
|
||||||
"mounts": [
|
"mounts": [
|
||||||
"source=/run/user/${localEnv:UID:1000}/podman/podman.sock,target=/run/podman/podman.sock,type=bind"
|
"source=/run/user/${localEnv:UID:1000}/podman/podman.sock,target=/run/podman/podman.sock,type=bind"
|
||||||
],
|
],
|
||||||
|
|
||||||
// Install DevTools
|
// Install DevTools
|
||||||
"postCreateCommand": "bash ./.devcontainer/install-dev-tools.sh",
|
"postCreateCommand": "bash ./.devcontainer/install-dev-tools.sh",
|
||||||
// Configure tool-specific properties.
|
// Configure tool-specific properties.
|
||||||
|
@ -42,6 +46,22 @@
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.formatOnPaste": true,
|
"editor.formatOnPaste": true,
|
||||||
|
"files.associations": {
|
||||||
|
"**/ansible/*.yml": "ansible",
|
||||||
|
"**/ansible/**/*.yml": "ansible"
|
||||||
|
},
|
||||||
|
"[ansible]": {
|
||||||
|
"editor.defaultFormatter": "redhat.ansible",
|
||||||
|
"editor.formatOnPaste": true,
|
||||||
|
"editor.insertSpaces": true,
|
||||||
|
"editor.tabSize": 2
|
||||||
|
},
|
||||||
|
// "ansible.ansible.path": "/home/vscode/.local/bin/ansible",
|
||||||
|
// "ansible.python.interpreterPath": "/usr/local/bin/python3",
|
||||||
|
"ansible.ansible.useFullyQualifiedCollectionNames": true,
|
||||||
|
"ansible.ansibleLint.enabled": true,
|
||||||
|
// "ansible.ansibleLint.path": "/home/vscode/.local/bin/ansible-lint",
|
||||||
|
"ansible.ansibleLint.arguments": "-c ${containerWorkspaceFolder}/ansible/.ansible-lint",
|
||||||
"cSpell.customDictionaries": {
|
"cSpell.customDictionaries": {
|
||||||
"project-words": {
|
"project-words": {
|
||||||
"name": "custom-dictionary",
|
"name": "custom-dictionary",
|
||||||
|
@ -64,11 +84,14 @@
|
||||||
"esbenp.prettier-vscode",
|
"esbenp.prettier-vscode",
|
||||||
"GitHub.vscode-pull-request-github",
|
"GitHub.vscode-pull-request-github",
|
||||||
"Gruntfuggly.todo-tree",
|
"Gruntfuggly.todo-tree",
|
||||||
|
"jamesls.jmespath-vscode",
|
||||||
"kokakiwi.vscode-just",
|
"kokakiwi.vscode-just",
|
||||||
"ms-azuretools.vscode-docker",
|
"ms-azuretools.vscode-docker",
|
||||||
"ms-kubernetes-tools.vscode-kubernetes-tools",
|
"ms-kubernetes-tools.vscode-kubernetes-tools",
|
||||||
"nico-castell.linux-desktop-file",
|
"nico-castell.linux-desktop-file",
|
||||||
|
"redhat.ansible",
|
||||||
"redhat.vscode-yaml",
|
"redhat.vscode-yaml",
|
||||||
|
"samuelcolvin.jinjahtml",
|
||||||
"shakram02.bash-beautify",
|
"shakram02.bash-beautify",
|
||||||
"streetsidesoftware.code-spell-checker"
|
"streetsidesoftware.code-spell-checker"
|
||||||
]
|
]
|
||||||
|
|
|
@ -22,6 +22,10 @@ echo ""
|
||||||
echo -e "${YELLOW}Installing additional tools${ENDCOLOR}"
|
echo -e "${YELLOW}Installing additional tools${ENDCOLOR}"
|
||||||
echo ""
|
echo ""
|
||||||
sudo apk add git-extras --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
|
sudo apk add git-extras --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
|
||||||
|
sudo apk add py3-pip
|
||||||
|
python3 -m pip install --user pipx
|
||||||
|
python3 -m pipx ensurepath
|
||||||
|
pipx install poetry
|
||||||
|
|
||||||
## Install podman remote
|
## Install podman remote
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -41,6 +45,18 @@ echo -e "${YELLOW}Configuring git${ENDCOLOR}"
|
||||||
echo ""
|
echo ""
|
||||||
git config --local commit.template .gitmessage
|
git config --local commit.template .gitmessage
|
||||||
|
|
||||||
|
# Install python dependencies
|
||||||
|
echo ""
|
||||||
|
echo -e "${YELLOW}Installing python dependencies${ENDCOLOR}"
|
||||||
|
echo ""
|
||||||
|
poetry install -C /workspaces/forge/ansible
|
||||||
|
|
||||||
|
# Install ansible dependencies
|
||||||
|
echo ""
|
||||||
|
echo -e "${YELLOW}Installing ansible dependencies${ENDCOLOR}"
|
||||||
|
echo ""
|
||||||
|
ansible-galaxy collection install -r /workspaces/forge/ansible/collections/requirements.yml
|
||||||
|
|
||||||
# Finish
|
# Finish
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${GREEN}Done. Happy coding!${ENDCOLOR}"
|
echo -e "${GREEN}Done. Happy coding!${ENDCOLOR}"
|
||||||
|
|
Loading…
Reference in a new issue