From c307315a12ba85365917d551731500298be60811 Mon Sep 17 00:00:00 2001 From: Florian Rey Date: Fri, 15 Mar 2024 12:59:51 +0100 Subject: [PATCH] [All] Update manala --- .manala.yaml | 9 ++++----- .manala/docker/Dockerfile | 26 +++++++++++++++++--------- .manala/docker/compose.yaml | 2 +- .manala/docker/docker.mk | 9 ++++++--- .manala/etc/direnv/config.toml | 5 +++++ .manala/etc/profile.d/message.sh | 9 ++++----- .manala/etc/profile.d/oh-my-bash.sh | 17 ++++++++++++++++- .manala/etc/profile.d/zz-direnv.sh | 8 ++++++++ 8 files changed, 61 insertions(+), 24 deletions(-) create mode 100644 .manala/etc/direnv/config.toml create mode 100644 .manala/etc/profile.d/zz-direnv.sh diff --git a/.manala.yaml b/.manala.yaml index a72356927..f4919bb74 100644 --- a/.manala.yaml +++ b/.manala.yaml @@ -29,14 +29,13 @@ system: [safe] directory = * ansible: - version: 2.15.5 + version: 2.15.8 dependencies: # Collection community.docker - - docker==6.1.3 + - docker==7.0.0 ansible-lint: version: 6.14.6 molecule: - version: 5.0.1 + version: 6.0.3 dependencies: - - molecule-plugins==23.5.0 - - molecule-plugins[docker]==23.5.0 + - molecule-plugins[docker]==23.5.3 diff --git a/.manala/docker/Dockerfile b/.manala/docker/Dockerfile index d7cd5c613..1ab678842 100644 --- a/.manala/docker/Dockerfile +++ b/.manala/docker/Dockerfile @@ -9,14 +9,18 @@ ARG DEBIAN_FRONTEND="noninteractive" ARG MANALA_USER_ID="1000" ARG MANALA_GROUP_ID="1000" -ARG GOSU_VERSION="1.16" -ARG GOMPLATE_VERSION="3.11.5" +ARG GOSU_VERSION="1.17" +ARG GOMPLATE_VERSION="3.11.7" +ARG DIRENV_VERSION="2.33.0" # The 'container' environment variable tells systemd that it's running inside a # Docker container environment. # It's also internally used for checking we're running inside a container. ENV container="docker" +# Default locale +ENV LANG C.UTF-8 + SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN \ @@ -49,6 +53,10 @@ RUN \ && curl -sSL "https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \ --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-$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \ + --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 @@ -60,7 +68,7 @@ RUN \ # System # ########## -ENV PIPX_HOME="/usr/local" +ENV PIPX_HOME="/usr/local/pipx" ENV PIPX_BIN_DIR="/usr/local/bin" RUN \ @@ -83,7 +91,8 @@ RUN \ RUN \ curl -sSL https://download.docker.com/linux/debian/gpg \ --output /etc/apt/keyrings/docker.asc \ - && printf "Types: deb\n\ + && printf "\ +Types: deb\n\ URIs: https://download.docker.com/linux/debian\n\ Suites: $(. /etc/os-release; echo "${VERSION_CODENAME}")\n\ Components: stable\n\ @@ -98,9 +107,9 @@ Signed-By: /etc/apt/keyrings/docker.asc\n\ # Ansible RUN \ pipx install --pip-args="--no-cache-dir" \ - ansible-core==2.15.5 \ + ansible-core==2.15.8 \ && pipx inject --pip-args="--no-cache-dir" ansible-core \ - docker==6.1.3 + docker==7.0.0 # Ansible Lint RUN \ @@ -120,11 +129,10 @@ RUN \ # Molecule RUN \ pipx install --pip-args="--no-cache-dir" \ - molecule==5.0.1 \ + molecule==6.0.3 \ && _MOLECULE_COMPLETE=bash_source molecule > /etc/bash_completion.d/molecule \ && pipx inject --pip-args="--no-cache-dir" molecule \ - molecule-plugins==23.5.0 \ - molecule-plugins[docker]==23.5.0 + molecule-plugins[docker]==23.5.3 # Run COPY docker/entrypoint.sh / diff --git a/.manala/docker/compose.yaml b/.manala/docker/compose.yaml index 83cc2ac11..0a0cf8e0f 100644 --- a/.manala/docker/compose.yaml +++ b/.manala/docker/compose.yaml @@ -11,7 +11,7 @@ services: build: context: .. dockerfile: docker/Dockerfile - image: manala-ansible-roles:20231019094123 + image: manala-ansible-roles:20240315115847 volumes: - ../..:${MANALA_DIR} environment: diff --git a/.manala/docker/docker.mk b/.manala/docker/docker.mk index cd87c75d2..a232759c5 100644 --- a/.manala/docker/docker.mk +++ b/.manala/docker/docker.mk @@ -42,11 +42,14 @@ MANALA_DOCKER_COMPOSE_BIN_DEFAULT = $(call manala_docker) compose MANALA_DOCKER_COMPOSE_BIN = $(MANALA_DOCKER_COMPOSE_BIN_DEFAULT) +MANALA_HOST_USER_ID = $(shell id -u) +MANALA_HOST_GROUP_ID = $(shell id -g) + MANALA_DOCKER_COMPOSE_ENV = \ DOCKER_BUILDKIT=1 \ - $(if $(MANALA_OS_LINUX), \ - MANALA_USER_ID=$(shell id -u) \ - MANALA_GROUP_ID=$(shell id -g) \ + $(and $(MANALA_OS_LINUX), $(filter-out 0, $(MANALA_HOST_USER_ID)), \ + MANALA_USER_ID=$(MANALA_HOST_USER_ID) \ + MANALA_GROUP_ID=$(MANALA_HOST_GROUP_ID) \ ) MANALA_DOCKER_COMPOSE_FILE = $(MANALA_DIR)/.manala/docker/compose.yaml diff --git a/.manala/etc/direnv/config.toml b/.manala/etc/direnv/config.toml new file mode 100644 index 000000000..396226a51 --- /dev/null +++ b/.manala/etc/direnv/config.toml @@ -0,0 +1,5 @@ +[whitelist] + +# Mark directories as “trusted” +# See: https://direnv.net/man/direnv.toml.1.html#codeprefixcode +prefix = [ "{{ .Env.MANALA_DIR }}" ] diff --git a/.manala/etc/profile.d/message.sh b/.manala/etc/profile.d/message.sh index de6ee101a..186fd470c 100644 --- a/.manala/etc/profile.d/message.sh +++ b/.manala/etc/profile.d/message.sh @@ -9,9 +9,8 @@ printf "\033[34m =-=-_-__=_-= _=_=-=_,-'\033[32m|\033[34m\"'\"\"-\033[32m|\033[3 printf "\033[34m =- _=-=- -_=-=_,-\" \033[32m|\033[34m\"\033[0m\n" printf "\033[34m =- =- -=.--\"\033[0m\n" printf "\n" -printf " \033[36m‣ ansible \033[35m2.15.5\033[0m\n" -printf " \033[36m· docker==6.1.3\033[0m\n" +printf " \033[36m‣ ansible \033[35m2.15.8\033[0m\n" +printf " \033[36m· docker==7.0.0\033[0m\n" printf " \033[36m‣ ansible-lint \033[35m6.14.6\033[0m\n" -printf " \033[36m‣ molecule \033[35m5.0.1\033[0m\n" -printf " \033[36m· molecule-plugins==23.5.0\033[0m\n" -printf " \033[36m· molecule-plugins[docker]==23.5.0\033[0m\n" +printf " \033[36m‣ molecule \033[35m6.0.3\033[0m\n" +printf " \033[36m· molecule-plugins[docker]==23.5.3\033[0m\n" diff --git a/.manala/etc/profile.d/oh-my-bash.sh b/.manala/etc/profile.d/oh-my-bash.sh index 6276b359a..fe240f8fd 100644 --- a/.manala/etc/profile.d/oh-my-bash.sh +++ b/.manala/etc/profile.d/oh-my-bash.sh @@ -11,6 +11,9 @@ export OSH=/usr/local/share/oh-my-bash # it'll load a random theme each time that oh-my-bash is loaded. OSH_THEME="font" +# If you set OSH_THEME to "random", you can ignore themes you don't like. +# OMB_THEME_RANDOM_IGNORED=("powerbash10k" "wanelo") + # Uncomment the following line to use case-sensitive completion. # OMB_CASE_SENSITIVE="true" @@ -41,6 +44,14 @@ COMPLETION_WAITING_DOTS="true" # much, much faster. DISABLE_UNTRACKED_FILES_DIRTY="true" +# Uncomment the following line if you don't want the repository to be considered dirty +# if there are untracked files. +# SCM_GIT_DISABLE_UNTRACKED_DIRTY="true" + +# Uncomment the following line if you want to completely ignore the presence +# of untracked files in the repository. +# SCM_GIT_IGNORE_UNTRACKED="true" + # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. One of the following values can # be used to specify the timestamp format. @@ -97,7 +108,7 @@ plugins=( # Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*) # Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: +# Example format: # if [ "$DISPLAY" ] || [ "$SSH" ]; then # plugins+=(tmux-autoattach) # fi @@ -131,3 +142,7 @@ source "$OSH"/oh-my-bash.sh # Example aliases # alias bashconfig="mate ~/.bashrc" # alias ohmybash="mate ~/.oh-my-bash" + +# Disable full path print after cd into a directory +# See: https://github.com/ohmybash/oh-my-bash/issues/201 +unset CDPATH diff --git a/.manala/etc/profile.d/zz-direnv.sh b/.manala/etc/profile.d/zz-direnv.sh new file mode 100644 index 000000000..24ea57374 --- /dev/null +++ b/.manala/etc/profile.d/zz-direnv.sh @@ -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'