=mostly improving terraform tools

This commit is contained in:
Gal Szkolnik 2022-08-26 12:07:53 -04:00
parent e7a7051698
commit 64add644e5
3 changed files with 17 additions and 5 deletions

View File

@ -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")")

View File

@ -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 '

View File

@ -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.