From 64add644e5e712ecddbd5fa6c7d8ce47a3ff74b3 Mon Sep 17 00:00:00 2001 From: Gal Szkolnik Date: Fri, 26 Aug 2022 12:07:53 -0400 Subject: [PATCH] =mostly improving terraform tools --- _home/dot_sz.shrc | 3 ++- _home/dot_sz.shrc.d/33_terraform.shortcuts | 14 ++++++++++++-- .../private_spacemacs/config.std/init.el | 5 +++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/_home/dot_sz.shrc b/_home/dot_sz.shrc index c92e937..633b4d5 100644 --- a/_home/dot_sz.shrc +++ b/_home/dot_sz.shrc @@ -3,10 +3,11 @@ case $- in *i*) echo "Welcome $USER to $(hostname)";; - *) return;; + *) [ -z "${INCLUDE_SZSHRC}" ] && return;; esac if [ -d ~/.sz.shrc.d ]; then + [ -z ${DBG_SZSHRC} ] || ps -p$$ -ho comm script_source=("$(find ~/.sz.shrc.d -maxdepth 1 -type d -name "$(ps -p$$ -ho comm).pre")") script_source+=("$(find ~/.sz.shrc.d -maxdepth 0 -type d)") script_source+=("$(find ~/.sz.shrc.d -maxdepth 1 -type d -name "$(ps -p$$ -ho comm).post")") diff --git a/_home/dot_sz.shrc.d/33_terraform.shortcuts b/_home/dot_sz.shrc.d/33_terraform.shortcuts index 9c52d99..5aa2e4d 100644 --- a/_home/dot_sz.shrc.d/33_terraform.shortcuts +++ b/_home/dot_sz.shrc.d/33_terraform.shortcuts @@ -44,7 +44,6 @@ if [[ -x $TERRAFORM_BIN ]]; then } } - alias tf!=_tfSetLogTS function _tfSetLogTS() { export TF_LOG_TS=$(date -d "today" +"%Y%m%d%H%M%S") } @@ -55,6 +54,9 @@ if [[ -x $TERRAFORM_BIN ]]; then [[ "${@}" =~ "-destroy" ]] && NAME="$1-destroy" echo "===_logs/0_$NAME.log===" > _logs/0_0_lastrun.log + echo "===_logs/${TF_LOG_TS}_$NAME.log===" \ + | tee --append _logs/0_0_lastrun.log \ + > _logs/0_$NAME.log [[ -z "$SZ_DEBUG" ]] || echo "Executing: terraform ${@}" { terraform "${@}" 2>&1 \ @@ -69,6 +71,12 @@ if [[ -x $TERRAFORM_BIN ]]; then less-tf - } + function tf0() { + _tfSetLogTS + [ $# -eq 0 ] && return + tf "$@" + } + function tf-plan() { [[ -z "$SZ_DEBUG" ]] || echo "DEBUG: tfplan ${@}" local _TF_TARGET="" @@ -78,6 +86,8 @@ if [[ -x $TERRAFORM_BIN ]]; then tf plan ${_TF_TARGET} "${@}" } + alias 'tf0-plan'='_tfSetLogTS; tf-plan ' + function get-tf-env() { local PATTERN="${1-}" compgen -v | grep "^TF_${PATTERN}" @@ -106,7 +116,7 @@ if [[ -x $TERRAFORM_BIN ]]; then clear-tf-env '[A-Z_]*TARGET$' } - alias tf-plan-destroy='tf-plan --destroy ' + alias tf-plan-destroy='tf0-plan --destroy ' alias tf-apply='tf apply ' alias tfp='tf-plan ' diff --git a/_home/private_dot_config/private__my.emacs/private_spacemacs/config.std/init.el b/_home/private_dot_config/private__my.emacs/private_spacemacs/config.std/init.el index 874b82c..10276cb 100644 --- a/_home/private_dot_config/private__my.emacs/private_spacemacs/config.std/init.el +++ b/_home/private_dot_config/private__my.emacs/private_spacemacs/config.std/init.el @@ -32,7 +32,8 @@ This function should only modify configuration layer settings." ;; List of configuration layers to load. dotspacemacs-configuration-layers - '(yaml + '(php + yaml python html javascript @@ -583,7 +584,7 @@ This function is called at the very end of Spacemacs initialization." '(evil-want-Y-yank-to-eol nil) '(ispell-dictionary nil) '(package-selected-packages - '(dockerfile-mode docker-compose-mode docker yaml-mode blacken code-cells company-anaconda anaconda-mode counsel-gtags counsel swiper ivy cython-mode dap-mode helm-cscope helm-pydoc importmagic epc ctable concurrent deferred live-py-mode lsp-pyright lsp-python-ms nose pip-requirements pipenv load-env-vars pippel poetry py-isort pydoc pyenv-mode pythonic pylookup pytest pyvenv sphinx-doc stickyfunc-enhance xcscope yapfify tagedit web-mode lsp-docker lsp-treemacs bui lsp-mode ggtags helm-gtags impatient-mode import-js grizzl js-doc js2-refactor multiple-cursors livid-mode nodejs-repl npm-mode prettier-js skewer-mode js2-mode simple-httpd tern web-beautify yasnippet-snippets unfill mwim helm-company helm-c-yasnippet fuzzy company-terraform terraform-mode hcl-mode company auto-yasnippet yasnippet ac-ispell auto-complete treemacs-magit smeargle orgit-forge orgit org-rich-yank org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download org-contrib org-cliplink org mmm-mode markdown-toc htmlize helm-org-rifle helm-ls-git helm-git-grep gnuplot gitignore-templates git-timemachine git-modes git-messenger git-link gh-md forge yaml markdown-mode magit ghub closql emacsql-sqlite emacsql treepy magit-section git-commit with-editor transient flyspell-correct-helm flyspell-correct flycheck-pos-tip pos-tip evil-org auto-dictionary ws-butler writeroom-mode winum which-key volatile-highlights vim-powerline vi-tilde-fringe uuidgen use-package undo-tree treemacs-projectile treemacs-persp treemacs-icons-dired treemacs-evil toc-org symon symbol-overlay string-inflection string-edit spacemacs-whitespace-cleanup spacemacs-purpose-popwin spaceline-all-the-icons space-doc restart-emacs request rainbow-delimiters quickrun popwin pcre2el password-generator paradox overseer org-superstar open-junk-file nameless multi-line macrostep lorem-ipsum link-hint inspector info+ indent-guide hybrid-mode hungry-delete holy-mode hl-todo highlight-parentheses highlight-numbers highlight-indentation hide-comnt help-fns+ helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-org helm-mode-manager helm-make helm-flx helm-descbinds helm-ag google-translate golden-ratio font-lock+ flycheck-package flycheck-elsa flx-ido fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-terminal-cursor-changer evil-surround evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-evilified-state evil-escape evil-ediff evil-easymotion evil-collection evil-cleverparens evil-args evil-anzu eval-sexp-fu emr elisp-slime-nav elisp-def editorconfig dumb-jump drag-stuff dotenv-mode dired-quick-sort diminish devdocs define-word column-enforce-mode clean-aindent-mode centered-cursor-mode auto-highlight-symbol auto-compile aggressive-indent ace-link ace-jump-helm-line))) + '(company-php ac-php-core company-phpactor drupal-mode geben php-auto-yasnippets php-extras php-mode phpactor composer php-runtime phpcbf phpunit dockerfile-mode docker-compose-mode docker yaml-mode blacken code-cells company-anaconda anaconda-mode counsel-gtags counsel swiper ivy cython-mode dap-mode helm-cscope helm-pydoc importmagic epc ctable concurrent deferred live-py-mode lsp-pyright lsp-python-ms nose pip-requirements pipenv load-env-vars pippel poetry py-isort pydoc pyenv-mode pythonic pylookup pytest pyvenv sphinx-doc stickyfunc-enhance xcscope yapfify tagedit web-mode lsp-docker lsp-treemacs bui lsp-mode ggtags helm-gtags impatient-mode import-js grizzl js-doc js2-refactor multiple-cursors livid-mode nodejs-repl npm-mode prettier-js skewer-mode js2-mode simple-httpd tern web-beautify yasnippet-snippets unfill mwim helm-company helm-c-yasnippet fuzzy company-terraform terraform-mode hcl-mode company auto-yasnippet yasnippet ac-ispell auto-complete treemacs-magit smeargle orgit-forge orgit org-rich-yank org-projectile org-category-capture org-present org-pomodoro alert log4e gntp org-mime org-download org-contrib org-cliplink org mmm-mode markdown-toc htmlize helm-org-rifle helm-ls-git helm-git-grep gnuplot gitignore-templates git-timemachine git-modes git-messenger git-link gh-md forge yaml markdown-mode magit ghub closql emacsql-sqlite emacsql treepy magit-section git-commit with-editor transient flyspell-correct-helm flyspell-correct flycheck-pos-tip pos-tip evil-org auto-dictionary ws-butler writeroom-mode winum which-key volatile-highlights vim-powerline vi-tilde-fringe uuidgen use-package undo-tree treemacs-projectile treemacs-persp treemacs-icons-dired treemacs-evil toc-org symon symbol-overlay string-inflection string-edit spacemacs-whitespace-cleanup spacemacs-purpose-popwin spaceline-all-the-icons space-doc restart-emacs request rainbow-delimiters quickrun popwin pcre2el password-generator paradox overseer org-superstar open-junk-file nameless multi-line macrostep lorem-ipsum link-hint inspector info+ indent-guide hybrid-mode hungry-delete holy-mode hl-todo highlight-parentheses highlight-numbers highlight-indentation hide-comnt help-fns+ helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-org helm-mode-manager helm-make helm-flx helm-descbinds helm-ag google-translate golden-ratio font-lock+ flycheck-package flycheck-elsa flx-ido fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-terminal-cursor-changer evil-surround evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-evilified-state evil-escape evil-ediff evil-easymotion evil-collection evil-cleverparens evil-args evil-anzu eval-sexp-fu emr elisp-slime-nav elisp-def editorconfig dumb-jump drag-stuff dotenv-mode dired-quick-sort diminish devdocs define-word column-enforce-mode clean-aindent-mode centered-cursor-mode auto-highlight-symbol auto-compile aggressive-indent ace-link ace-jump-helm-line))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful.