0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-08-22 19:38:35 +00:00

feat(devcontainer): configure provider override in post attach command (#1481)

* feat(devcontainer): update terraform version
* refactor(devcontainer): move post attach command to separate script
* feat(devcontainer): configure provider override in post attach command


---------

Signed-off-by: Björn Brauer <zaubernerd@zaubernerd.de>
This commit is contained in:
Björn Brauer 2024-08-13 01:20:35 +02:00 committed by GitHub
parent dd6d5ec88f
commit daaedf2d99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 3 deletions

View File

@ -8,12 +8,11 @@
// Features to add to the dev container. More info: https://containers.dev/features. // Features to add to the dev container. More info: https://containers.dev/features.
"features": { "features": {
"ghcr.io/devcontainers/features/terraform:1": { "ghcr.io/devcontainers/features/terraform:1": {
"version": "1.7.2" "version": "1.9.4"
} }
}, },
// Workaround for https://github.com/orgs/community/discussions/75161 "postAttachCommand": ["bash", "./.devcontainer/post-attach.sh"],
"postAttachCommand": "unset GIT_COMMITTER_NAME; unset GIT_COMMITTER_EMAIL;",
// Use 'forwardPorts' to make a list of ports inside the container available locally. // Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [], // "forwardPorts": [],

View File

@ -0,0 +1,19 @@
#!/usr/bin/bash
# Workaround for https://github.com/orgs/community/discussions/75161
unset GIT_COMMITTER_NAME
unset GIT_COMMITTER_EMAIL
cat <<EOF > ~/.terraformrc
provider_installation {
dev_overrides {
"bpg/proxmox" = "${GOPATH}/bin/"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
EOF