From 3313da86bf850d84924874521df849467758b44a Mon Sep 17 00:00:00 2001 From: Bohdan Sukhomlinov Date: Tue, 10 Oct 2023 18:46:06 +0300 Subject: [PATCH] direnv --- .github/workflows/direnv.yml | 31 +++++++++++++++++++++++++++++++ defaults/main/direnv.yml | 7 +++++++ defaults/main/zsh.yml | 11 +++++------ molecule/direnv/converge.yml | 13 +++++++++++++ molecule/direnv/molecule.yml | 16 ++++++++++++++++ molecule/direnv/verify.yml | 9 +++++++++ 6 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/direnv.yml create mode 100644 defaults/main/direnv.yml create mode 100644 molecule/direnv/converge.yml create mode 100644 molecule/direnv/molecule.yml create mode 100644 molecule/direnv/verify.yml diff --git a/.github/workflows/direnv.yml b/.github/workflows/direnv.yml new file mode 100644 index 0000000..da43bff --- /dev/null +++ b/.github/workflows/direnv.yml @@ -0,0 +1,31 @@ +--- +name: Molecule +on: + push: + paths: + - 'defaults/main/direnv.yml' + - 'tasks/**' + - 'molecule/direnv/**' + pull_request: + branches: [master] + paths: + - 'defaults/main/direnv.yml' + - 'tasks/**' + - 'molecule/direnv/**' +jobs: + tests: + runs-on: ubuntu-latest + name: component:direnv + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: ${{ github.repository }} + - name: Molecule + uses: gofrolist/molecule-action@v2 + with: + molecule_command: test + molecule_args: -d docker -s direnv + molecule_working_dir: dnullproject/components + env: + ANSIBLE_FORCE_COLOR: '1' diff --git a/defaults/main/direnv.yml b/defaults/main/direnv.yml new file mode 100644 index 0000000..0bf5c77 --- /dev/null +++ b/defaults/main/direnv.yml @@ -0,0 +1,7 @@ +--- +# direnv +role_component: + direnv: + install: + brew: + - direnv diff --git a/defaults/main/zsh.yml b/defaults/main/zsh.yml index 19779f8..2618314 100644 --- a/defaults/main/zsh.yml +++ b/defaults/main/zsh.yml @@ -86,15 +86,15 @@ role_component: - PATH="$PATH:$HOME/.stew/bin" - PATH="$PATH:$HOME/install/flutter/bin" # - PATH="$PATH:$HOME/ENV/${VENV}/bin" - - PATH="$PATH:$HOME/dNull/ues.lib" - - PATH="$PATH:$HOME/dNull/ues.utils" - - PATH="$PATH:$HOME/dNull/dnull" + # - PATH="$PATH:$HOME/dnull/ues.lib" + # - PATH="$PATH:$HOME/dnull/ues.utils" + # - PATH="$PATH:$HOME/dnull/dnull" - PATH="$PATH:$HOME/.pulumi/bin" - PATH="$PATH:$HOME/.pub-cache/bin" - SHELL=/bin/zsh - SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock - VAGRANT_HOME='~/.vagrant.d' - - UES_LIB=~/dNull/ues.lib + # - UES_LIB=~/dnull/ues.lib - KUBECONFIG="${HOME}/.kube/config" - HOSTALIASES=~/.hosts - RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}' @@ -128,8 +128,7 @@ role_component: - maciar='TERM=xterm-color ssh maciar' - gitroot='cd $(git rev-parse --show-toplevel)' - mux='tmuxinator' - - ii='/bin/bash ~/dnull/dnull/utils/components_dmenu.sh' - sources: ['~dNull/secrets/secrets.sh || echo -e "[.!]\tNo secrets found!"'] + sources: [] vault: [] evals: - direnv hook zsh diff --git a/molecule/direnv/converge.yml b/molecule/direnv/converge.yml new file mode 100644 index 0000000..9225e13 --- /dev/null +++ b/molecule/direnv/converge.yml @@ -0,0 +1,13 @@ +--- +- name: Converge + hosts: all + gather_facts: true + remote_user: root + tasks: + # TODO: resolve deps + - name: Testing -- dummy + include_role: + name: components + vars: + role_component: + components: [dummy] diff --git a/molecule/direnv/molecule.yml b/molecule/direnv/molecule.yml new file mode 100644 index 0000000..45cb9cc --- /dev/null +++ b/molecule/direnv/molecule.yml @@ -0,0 +1,16 @@ +--- +dependency: + name: galaxy +driver: + name: docker +platforms: + - name: ubuntu_2004 + image: mpaivabarbosa/molecule-systemd-ubuntu:20.04 + pre_build_image: true +provisioner: + name: ansible + config_options: + defaults: + hash_behaviour: merge +verifier: + name: ansible diff --git a/molecule/direnv/verify.yml b/molecule/direnv/verify.yml new file mode 100644 index 0000000..98c87a2 --- /dev/null +++ b/molecule/direnv/verify.yml @@ -0,0 +1,9 @@ +--- +# This is an example playbook to execute Ansible tests. +- name: Verify + hosts: all + gather_facts: false + tasks: + - name: Example assertion + ansible.builtin.assert: + that: true