generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
# Terraform State management using Git (terraform-backend-git) | ||
|
||
Installs terraform-backend-git binary. | ||
|
||
## Example Usage | ||
|
||
```json | ||
"features": { | ||
"ghcr.io/skriptfabrik/devcontainer-features/terraform-backend-git:1": {} | ||
} | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
--- | ||
|
||
_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/skriptfabrik/devcontainer-features/blob/main/src/terraform-backend-git/devcontainer-feature.json). Add additional notes to a `NOTES.md`._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "terraform-backend-git", | ||
"version": "1.0.0", | ||
"name": "Terraform State management using Git", | ||
"documentationURL": "https://github.com/skriptfabrik/devcontainer-features/tree/main/src/terraform-backend-git", | ||
"description": "Installs terraform-backend-git binary.", | ||
"installsAfter": [ | ||
"ghcr.io/devcontainers/features/common-utils" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
VERSION="${VERSION:-"latest"}" | ||
|
||
# Checks if packages are installed and installs them if not | ||
check_packages() { | ||
if ! dpkg -s "$@" > /dev/null 2>&1; then | ||
apt_get_update | ||
apt-get -y install --no-install-recommends "$@" | ||
fi | ||
} | ||
|
||
if [ "$(id -u)" -ne 0 ]; then | ||
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' | ||
exit 1 | ||
fi | ||
|
||
# Install dependencies if missing | ||
check_packages curl ca-certificates | ||
|
||
# Fetch latest version if needed | ||
if [ "${VERSION}" = "latest" ]; then | ||
export VERSION=$(curl -s https://api.github.com/repos/plumber-cd/terraform-backend-git/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') | ||
fi | ||
|
||
# Install ARM or x86 version of hugo based on current machine architecture | ||
if [ "$(uname -m)" = "aarch64" ]; then | ||
ARCH="arm64" | ||
else | ||
ARCH="amd64" | ||
fi | ||
|
||
curl -sSLo /usr/local/bin/terraform-backend-git "https://github.com/plumber-cd/terraform-backend-git/releases/download/v${VERSION}/terraform-backend-git-linux-${ARCH}" | ||
|
||
chmod +x /usr/local/bin/terraform-backend-git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib | ||
# Provides the 'check' and 'reportResults' commands. | ||
source dev-container-features-test-lib | ||
|
||
# Definition specific tests | ||
. /etc/os-release | ||
|
||
# Scenario-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. Syntax is... | ||
# check <LABEL> <cmd> [args...] | ||
check "distro" test "${ID}" = "alpine" | ||
check "check for terraform-backend-git" terraform-backend-git --version | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib | ||
# Provides the 'check' and 'reportResults' commands. | ||
source dev-container-features-test-lib | ||
|
||
# Definition specific tests | ||
. /etc/os-release | ||
|
||
# Scenario-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. Syntax is... | ||
# check <LABEL> <cmd> [args...] | ||
check "distro" test "${ID}" = "debian" | ||
check "check for terraform-backend-git" terraform-backend-git --version | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib | ||
# Provides the 'check' and 'reportResults' commands. | ||
source dev-container-features-test-lib | ||
|
||
# Definition specific tests | ||
. /etc/os-release | ||
|
||
# Scenario-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. Syntax is... | ||
# check <LABEL> <cmd> [args...] | ||
check "distro" test "${ID}" = "fedora" | ||
check "check for terraform-backend-git" terraform-backend-git --version | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"alpine": { | ||
"image": "alpine:latest", | ||
"features": { | ||
"terraform-backend-git-cli": {} | ||
} | ||
}, | ||
"debian": { | ||
"image": "debian:latest", | ||
"features": { | ||
"terraform-backend-git-cli": {} | ||
} | ||
}, | ||
"fedora": { | ||
"image": "fedora:latest", | ||
"features": { | ||
"terraform-backend-git-cli": {} | ||
} | ||
}, | ||
"ubuntu": { | ||
"image": "ubuntu:latest", | ||
"features": { | ||
"terraform-backend-git-cli": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib | ||
# Provides the 'check' and 'reportResults' commands. | ||
source dev-container-features-test-lib | ||
|
||
# Feature-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. Syntax is... | ||
# check <LABEL> <cmd> [args...] | ||
check "check for terraform-backend-git" terraform-backend-git --version | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library bundled with the devcontainer CLI | ||
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib | ||
# Provides the 'check' and 'reportResults' commands. | ||
source dev-container-features-test-lib | ||
|
||
# Definition specific tests | ||
. /etc/os-release | ||
|
||
# Scenario-specific tests | ||
# The 'check' command comes from the dev-container-features-test-lib. Syntax is... | ||
# check <LABEL> <cmd> [args...] | ||
check "distro" test "${ID}" = "ubuntu" | ||
check "check for terraform-backend-git" terraform-backend-git --version | ||
|
||
# Report results | ||
# If any of the checks above exited with a non-zero exit code, the test will fail. | ||
reportResults |