Skip to content

Commit

Permalink
Merge pull request #404 from manala/lazy/direnv
Browse files Browse the repository at this point in the history
[Lazy] Introduce direnv
  • Loading branch information
nervo authored Dec 4, 2023
2 parents 6aa26c2 + 147c172 commit 7e191ea
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lazy.ansible/.manala/docker/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG MANALA_GROUP_ID="1000"

ARG GOSU_VERSION="1.16"
ARG GOMPLATE_VERSION="3.11.5"
ARG DIRENV_VERSION="2.33.0"

# The 'container' environment variable tells systemd that it's running inside a
# Docker container environment.
Expand Down Expand Up @@ -49,6 +50,10 @@ RUN \
&& curl -sSL "https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \
--output /usr/local/bin/gomplate \
&& chmod +x /usr/local/bin/gomplate \
# Direnv
&& curl -sSL "https://github.com/direnv/direnv/releases/download/v${DIRENV_VERSION}/direnv.linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \
--output /usr/local/bin/direnv \
&& chmod +x /usr/local/bin/direnv \
# Bash completion
&& install --verbose --mode 0755 --directory /etc/bash_completion.d \
# Oh My Bash
Expand Down
5 changes: 5 additions & 0 deletions lazy.ansible/.manala/etc/direnv/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[whitelist]

# Mark directories as “trusted”
# See: https://direnv.net/man/direnv.toml.1.html#codeprefixcode
prefix = [ "{{ .Env.MANALA_DIR }}" ]
8 changes: 8 additions & 0 deletions lazy.ansible/.manala/etc/profile.d/zz-direnv.sh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eval "$(direnv hook bash)"

# Config directory
export DIRENV_CONFIG=/etc/direnv

# Faint output
# See: https://github.com/direnv/direnv/wiki/Quiet-or-Silence-direnv
export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m'
5 changes: 5 additions & 0 deletions lazy.ansible/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ command:
exit-status: 0
stdout:
- gomplate version 3.11.5
# Direnv
direnv --version:
exit-status: 0
stdout:
- 2.33.0
# Goss
goss --version:
exit-status: 0
Expand Down
5 changes: 5 additions & 0 deletions lazy.kubernetes/.manala/docker/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG MANALA_GROUP_ID="1000"

ARG GOSU_VERSION="1.16"
ARG GOMPLATE_VERSION="3.11.5"
ARG DIRENV_VERSION="2.33.0"

# The 'container' environment variable tells systemd that it's running inside a
# Docker container environment.
Expand Down Expand Up @@ -49,6 +50,10 @@ RUN \
&& curl -sSL "https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \
--output /usr/local/bin/gomplate \
&& chmod +x /usr/local/bin/gomplate \
# Direnv
&& curl -sSL "https://github.com/direnv/direnv/releases/download/v${DIRENV_VERSION}/direnv.linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \
--output /usr/local/bin/direnv \
&& chmod +x /usr/local/bin/direnv \
# Bash completion
&& install --verbose --mode 0755 --directory /etc/bash_completion.d \
# Oh My Bash
Expand Down
5 changes: 5 additions & 0 deletions lazy.kubernetes/.manala/etc/direnv/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[whitelist]

# Mark directories as “trusted”
# See: https://direnv.net/man/direnv.toml.1.html#codeprefixcode
prefix = [ "{{ .Env.MANALA_DIR }}" ]
8 changes: 8 additions & 0 deletions lazy.kubernetes/.manala/etc/profile.d/zz-direnv.sh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eval "$(direnv hook bash)"

# Config directory
export DIRENV_CONFIG=/etc/direnv

# Faint output
# See: https://github.com/direnv/direnv/wiki/Quiet-or-Silence-direnv
export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m'
5 changes: 5 additions & 0 deletions lazy.kubernetes/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ command:
exit-status: 0
stdout:
- gomplate version 3.11.5
# Direnv
direnv --version:
exit-status: 0
stdout:
- 2.33.0
# Goss
goss --version:
exit-status: 0
Expand Down
5 changes: 5 additions & 0 deletions lazy.symfony/.manala/docker/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ARG MANALA_GROUP_ID="1000"

ARG GOSU_VERSION="1.16"
ARG GOMPLATE_VERSION="3.11.5"
ARG DIRENV_VERSION="2.33.0"

# The 'container' environment variable tells systemd that it's running inside a
# Docker container environment.
Expand Down Expand Up @@ -49,6 +50,10 @@ RUN \
&& curl -sSL "https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \
--output /usr/local/bin/gomplate \
&& chmod +x /usr/local/bin/gomplate \
# Direnv
&& curl -sSL "https://github.com/direnv/direnv/releases/download/v${DIRENV_VERSION}/direnv.linux-{{ include "arch_map" (dict "amd64" "amd64" "arm64" "arm64") }}" \
--output /usr/local/bin/direnv \
&& chmod +x /usr/local/bin/direnv \
# Bash completion
&& install --verbose --mode 0755 --directory /etc/bash_completion.d \
# Oh My Bash
Expand Down
5 changes: 5 additions & 0 deletions lazy.symfony/.manala/etc/direnv/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[whitelist]

# Mark directories as “trusted”
# See: https://direnv.net/man/direnv.toml.1.html#codeprefixcode
prefix = [ "{{ .Env.MANALA_DIR }}" ]
8 changes: 8 additions & 0 deletions lazy.symfony/.manala/etc/profile.d/zz-direnv.sh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eval "$(direnv hook bash)"

# Config directory
export DIRENV_CONFIG=/etc/direnv

# Faint output
# See: https://github.com/direnv/direnv/wiki/Quiet-or-Silence-direnv
export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m'
5 changes: 5 additions & 0 deletions lazy.symfony/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ command:
exit-status: 0
stdout:
- gomplate version 3.11.5
# Direnv
direnv --version:
exit-status: 0
stdout:
- 2.33.0
# Goss
goss --version:
exit-status: 0
Expand Down

0 comments on commit 7e191ea

Please sign in to comment.