From 29d6ac9bc84614c758ebfac86583be5b0471a1a2 Mon Sep 17 00:00:00 2001 From: Yuki Iwanaga Date: Thu, 30 May 2024 22:04:35 +0900 Subject: [PATCH] Fix CI (#102) --- .github/workflows/provisioning.yml | 24 +- config/rbenv/default-gems | 1 + provision | 47 ++-- provisioning/config.yml | 277 +++++++++------------ provisioning/playbook.yml | 3 + provisioning/roles/flutter/tasks/main.yml | 5 - provisioning/roles/golang/tasks/main.yml | 12 +- provisioning/roles/homebrew/tasks/main.yml | 20 +- provisioning/roles/java/tasks/main.yml | 12 +- provisioning/roles/nodejs/tasks/main.yml | 4 +- provisioning/roles/ruby/tasks/main.yml | 7 +- provisioning/roles/rust/tasks/main.yml | 7 +- provisioning/roles/vagrant/tasks/main.yml | 7 +- provisioning/roles/vim/tasks/main.yml | 34 ++- provisioning/roles/vscode/tasks/main.yml | 31 ++- 15 files changed, 251 insertions(+), 240 deletions(-) diff --git a/.github/workflows/provisioning.yml b/.github/workflows/provisioning.yml index e4d5c671..b8ea1846 100644 --- a/.github/workflows/provisioning.yml +++ b/.github/workflows/provisioning.yml @@ -2,13 +2,15 @@ name: provisioning on: push: + workflow_dispatch: schedule: # Every Monday, at 10:00 JST - cron: "0 1 * * 1" jobs: macos: - runs-on: macos-12 # https://github.com/actions/virtual-environments + # cf. https://github.com/actions/runner-images/tree/main/images/macos + runs-on: macos-14 env: HOMEBREW_VERBOSE: 1 DOTFILES_NOEDIT_SECRETS: 1 @@ -16,27 +18,27 @@ jobs: fail-fast: false matrix: include: - - tags: base,install.homebrew.formula - - tags: base,lang - - tags: install,app,system + - name: fundamental + tags: base,install.homebrew.tap,install.homebrew.formula + - name: language support + tags: base,lang + - name: apps and system + tags: install,app,system skip_tags: install.homebrew.formula + name: ${{ matrix.name }} steps: - uses: actions/checkout@v2 - name: Link to home run: ln -sf "$PWD" "$HOME/dotfiles" - # Refer to https://github.com/actions/runner-images/tree/main/images/macos/provision - name: Uninstall homebrew run: | - set -euxo pipefail - - brew list --cask | xargs brew uninstall --force - brew list | xargs brew uninstall --force --ignore-dependencies - + # cf. https://github.com/homebrew/install#uninstall-homebrew NONINTERACTIVE=1 HAVE_SUDO_ACCESS=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" - rm -rf /usr/local/bin/* + # Remove residual files + sudo rm -rf /opt/homebrew/ - name: Install SSH key run: | diff --git a/config/rbenv/default-gems b/config/rbenv/default-gems index 141efe24..4c01cba8 100644 --- a/config/rbenv/default-gems +++ b/config/rbenv/default-gems @@ -5,5 +5,6 @@ rails solargraph # iOS development +cocoapods synx xcode-install diff --git a/provision b/provision index 4a0bb970..4f7de303 100755 --- a/provision +++ b/provision @@ -68,12 +68,7 @@ clone_or_update_repo() { fi } -load_envs() { - export ANYENV_INIT_CACHE_DISABLED=1 - source "$DOTFILES_PATH/shell/profile" -} - -check_xcode_license_approved() { +accept_xcode_license() { echo 'Agreeing to Xcode license...' if ! [[ "$(/usr/bin/xcrun clang 2>&1 || true)" =~ 'license' ]]; then @@ -85,6 +80,22 @@ check_xcode_license_approved() { echo 'done' } +install_rosetta2() { + echo 'Installing Rosetta 2...' + if [ -d /usr/libexec/rosetta ]; then + echo 'skip (already installed)' + return + fi + sudo softwareupdate --install-rosetta --agree-to-license + echo 'done' +} + +load_envs() { + export ANYENV_INIT_CACHE_DISABLED=1 + # shellcheck source=/dev/null + . "$DOTFILES_PATH/shell/profile" +} + install_homebrew() { command -v 'brew' > /dev/null 2>&1 && return @@ -93,6 +104,15 @@ install_homebrew() { echo 'done' } +install_python3() { + command -v 'python3' > /dev/null 2>&1 && return + python3 --version > /dev/null 2>&1 && return + + echo 'Installing python3...' + brew install python@3.12 + echo 'done' +} + install_ansible() { command -v 'ansible' > /dev/null 2>&1 && return @@ -101,16 +121,6 @@ install_ansible() { echo 'done' } -install_rosetta2() { - echo 'Installing Rosetta 2...' - if [ -d /usr/libexec/rosetta ]; then - echo 'skip (already installed)' - return - fi - sudo softwareupdate --install-rosetta --agree-to-license - echo 'done' -} - run_provisioning() { echo 'Provisioning...' @@ -140,12 +150,13 @@ main() { print_header check_os clone_or_update_repo - check_xcode_license_approved + accept_xcode_license + install_rosetta2 load_envs install_homebrew + install_python3 install_ansible - install_rosetta2 run_provisioning "$@" } diff --git a/provisioning/config.yml b/provisioning/config.yml index 15ca667b..7b0f3868 100644 --- a/provisioning/config.yml +++ b/provisioning/config.yml @@ -1,163 +1,148 @@ homebrew: + taps: + - 1password/tap # for 1password-cli + - creasty/tools # for keyboard, rid + - ktr0731/evans # for evans + # brew list --cask --full-name - applications: - - 1password # https://1password.com/ + casks: + - 1password # https://1password.com/ - 1password/tap/1password-cli # https://developer.1password.com/docs/cli - - adobe-creative-cloud # https://creative.adobe.com/products/creative-cloud - - alacritty # https://github.com/jwilm/alacritty - - appcleaner # https://freemacsoft.net/appcleaner/ - - chromedriver # https://sites.google.com/a/chromium.org/chromedriver/home - - creasty/tools/keyboard # https://github.com/creasty/Keyboard - - docker # https://www.docker.com/community-edition - - figma # https://www.figma.com/ - - google-chat # https://gsuite.google.com/products/chat/ - - google-chrome # https://www.google.com/chrome/ - - google-cloud-sdk # https://cloud.google.com/sdk/ - - google-drive # https://www.google.com/drive/ - - google-japanese-ime # https://www.google.co.jp/ime/ - - imageoptim # https://imageoptim.com/mac - - istat-menus # https://bjango.com/mac/istatmenus/ - - kitty # https://github.com/kovidgoyal/kitty - - ngrok # https://ngrok.com/ - - notion # https://www.notion.so/ - - proxyman # https://proxyman.io/ - - pushplaylabs-sidekick # https://www.meetsidekick.com/ - - qlcolorcode # https://github.com/anthonygelibert/QLColorCode - - qlmarkdown # https://github.com/toland/qlmarkdown - - qlstephen # https://whomwah.github.io/qlstephen/ - - quicklook-json # http://www.sagtau.com/quicklookjson.html - - raycast # https://raycast.app/ - - rightfont # https://rightfontapp.com/ - - spotify # https://www.spotify.com/ - - tableplus # https://tableplus.io/ - - tunnelbear # https://www.tunnelbear.com/ - - webpquicklook # https://github.com/emin/WebPQuickLook + - adobe-creative-cloud # https://creative.adobe.com/products/creative-cloud + - alacritty # https://github.com/jwilm/alacritty + - appcleaner # https://freemacsoft.net/appcleaner/ + - chromedriver # https://sites.google.com/a/chromium.org/chromedriver/home + - creasty/tools/keyboard # https://github.com/creasty/Keyboard + - docker # https://www.docker.com/community-edition + - figma # https://www.figma.com/ + - google-chat # https://gsuite.google.com/products/chat/ + - google-chrome # https://www.google.com/chrome/ + - google-cloud-sdk # https://cloud.google.com/sdk/ + - google-drive # https://www.google.com/drive/ + - google-japanese-ime # https://www.google.co.jp/ime/ + - imageoptim # https://imageoptim.com/mac + - istat-menus # https://bjango.com/mac/istatmenus/ + - kitty # https://github.com/kovidgoyal/kitty + - ngrok # https://ngrok.com/ + - notion # https://www.notion.so/ + - proxyman # https://proxyman.io/ + - pushplaylabs-sidekick # https://www.meetsidekick.com/ + - qlcolorcode # https://github.com/anthonygelibert/QLColorCode + - qlmarkdown # https://github.com/toland/qlmarkdown + - qlstephen # https://whomwah.github.io/qlstephen/ + - quicklook-json # http://www.sagtau.com/quicklookjson.html + - raycast # https://raycast.app/ + - rightfont # https://rightfontapp.com/ + - spotify # https://www.spotify.com/ + - tableplus # https://tableplus.io/ + - tunnelbear # https://www.tunnelbear.com/ + - webpquicklook # https://github.com/emin/WebPQuickLook # brew leaves | xargs brew desc --eval-all | sed -E 's/^([^:]*): /- \1 # /g' - packages: - - awscli # Official Amazon AWS command-line interface - - bat # Clone of cat(1) with syntax highlighting and Git integration - - circleci # Enables you to reproduce the CircleCI environment locally - - cloc # Statistics utility to count lines of code - - cmake # Cross-platform make - - creasty/tools/rid # Run commands in container as if were native - - ctags # Reimplementation of ctags(1) - - curl # Get a file from an HTTP, HTTPS or FTP server - - deno # Secure runtime for JavaScript and TypeScript - - difftastic # Diff that understands syntax - - direnv # Load/unload environment variables based on $PWD - - envchain # Secure your credentials in environment variables - - expect # Program that can automate interactive applications - - eza # Modern, maintained replacement for ls - - fd # Simple, fast and user-friendly alternative to find - - ffmpeg # Play, record, convert, and stream audio and video - - gh # GitHub command-line tool - - ghq # Remote repository management made easy - - git # Distributed revision control system - - git-filter-repo # Quickly rewrite git repository history - - git-lfs # Git extension for versioning large files - - gnupg # GNU Pretty Good Privacy (PGP) package - - graphviz # Graph visualization software from AT&T and Bell Labs - - hyperfine # Command-line benchmarking tool - - imagemagick # Tools and libraries to manipulate images in many formats - - jo # JSON output from a shell - - jq # Lightweight and flexible command-line JSON processor + formulas: + - awscli # Official Amazon AWS command-line interface + - bat # Clone of cat(1) with syntax highlighting and Git integration + - circleci # Enables you to reproduce the CircleCI environment locally + - cloc # Statistics utility to count lines of code + - creasty/tools/rid # Run commands in container as if were native + - ctags # Reimplementation of ctags(1) + - curl # Get a file from an HTTP, HTTPS or FTP server + - deno # Secure runtime for JavaScript and TypeScript + - difftastic # Diff that understands syntax + - direnv # Load/unload environment variables based on $PWD + - envchain # Secure your credentials in environment variables + - expect # Program that can automate interactive applications + - eza # Modern, maintained replacement for ls + - fd # Simple, fast and user-friendly alternative to find + - ffmpeg # Play, record, convert, and stream audio and video + - gh # GitHub command-line tool + - ghq # Remote repository management made easy + - git # Distributed revision control system + - git-filter-repo # Quickly rewrite git repository history + - git-lfs # Git extension for versioning large files + - gnupg # GNU Pretty Good Privacy (PGP) package + - graphviz # Graph visualization software from AT&T and Bell Labs + - hyperfine # Command-line benchmarking tool + - imagemagick # Tools and libraries to manipulate images in many formats + - jo # JSON output from a shell + - jq # Lightweight and flexible command-line JSON processor - ktr0731/evans/evans # Evans: more expressive universal gRPC client - - libiconv # Conversion library - - libpq # Postgres C API library - - massren # Easily rename multiple files using your text editor - - ngrep # Network grep - - nkf # Network Kanji code conversion Filter (NKF) - - parallel # Shell command parallelization utility - - pastel # Command-line tool to generate, analyze, convert and manipulate colors - - peco # Simplistic interactive filtering tool - - procs # Modern replacement for ps written by Rust - - protobuf # Protocol buffers (Google's data interchange format) - - ripgrep # Search tool like grep and The Silver Searcher - - sd # Intuitive find & replace CLI - - terraform # Tool to build, change, and version infrastructure - - tmux # Terminal multiplexer - - trash # CLI tool that moves files or folder to the trash - - webp # Image format providing lossless and lossy compression for web images - - xh # Friendly and fast tool for sending HTTP requests + - libiconv # Conversion library + - libpq # Postgres C API library + - massren # Easily rename multiple files using your text editor + - ngrep # Network grep + - nkf # Network Kanji code conversion Filter (NKF) + - parallel # Shell command parallelization utility + - pastel # Command-line tool to generate, analyze, convert and manipulate colors + - peco # Simplistic interactive filtering tool + - procs # Modern replacement for ps written by Rust + - protobuf # Protocol buffers (Google's data interchange format) + - ripgrep # Search tool like grep and The Silver Searcher + - sd # Intuitive find & replace CLI + - terraform # Tool to build, change, and version infrastructure + - tmux # Terminal multiplexer + - trash # CLI tool that moves files or folder to the trash + - webp # Image format providing lossless and lossy compression for web images + - xh # Friendly and fast tool for sending HTTP requests launchagent: - plist_dir: '{{ dotfiles_path }}/config/launchagent' + plist_dir: "{{ dotfiles_path }}/config/launchagent" link: # XDG config directory config/alacritty: .config/alacritty - config/bat: .config/bat - config/git: .config/git - config/kitty: .config/kitty - config/peco: .config/peco + config/bat: .config/bat + config/git: .config/git + config/kitty: .config/kitty + config/peco: .config/peco config/ripgreprc: .config/.ripgreprc - config/tmux: .config/tmux + config/tmux: .config/tmux # Home directory - home/ansible.cfg: .ansible.cfg - home/aws/config: .aws/config + home/ansible.cfg: .ansible.cfg + home/aws/config: .aws/config home/bundle/config: .bundle/config - home/cargo/config: .cargo/config - home/ctags: .ctags - home/curlrc: .curlrc - home/fdignore: .fdignore - home/gemrc: .gemrc - home/irbrc: .irbrc - home/pgclirc: .pgclirc - home/pryrc: .pryrc - home/railsrc: .railsrc - home/rgignore: .rgignore - home/rspec: .rspec - home/rubocop.yml: .rubocop.yml + home/cargo/config: .cargo/config + home/ctags: .ctags + home/curlrc: .curlrc + home/fdignore: .fdignore + home/gemrc: .gemrc + home/irbrc: .irbrc + home/pgclirc: .pgclirc + home/pryrc: .pryrc + home/railsrc: .railsrc + home/rgignore: .rgignore + home/rspec: .rspec + home/rubocop.yml: .rubocop.yml # Special - nvim: .config/nvim + nvim: .config/nvim shell/bash/bash_profile: .bash_profile - shell/bash/bashrc: .bashrc - shell/profile: .profile - shell/zsh/zshenv: .zshenv - shell/zsh/zshrc: .zshrc - shell/zsh: .zsh + shell/bash/bashrc: .bashrc + shell/profile: .profile + shell/zsh/zshenv: .zshenv + shell/zsh/zshrc: .zshrc + shell/zsh: .zsh anyenv: - dir: '{{ home_path }}/.anyenv' - plugins_dir: '{{ home_path }}/.anyenv/plugins' - envs_dir: '{{ home_path }}/.anyenv/envs' - libexec_dir: '{{ home_path }}/.anyenv/libexec' - -golang: - tools: - - golangci/tap/golangci-lint # Fast linters runner for Go - - gopls # Language server for the Go language + dir: "{{ home_path }}/.anyenv" + plugins_dir: "{{ home_path }}/.anyenv/plugins" + envs_dir: "{{ home_path }}/.anyenv/envs" + libexec_dir: "{{ home_path }}/.anyenv/libexec" nodejs: - default_packages_path: '{{ dotfiles_path }}/config/nodenv/default-packages' + default_packages_path: "{{ dotfiles_path }}/config/nodenv/default-packages" # https://nodejs.org/en versions: - - '18.15.0' - - plugins: - - nodenv/nodenv-default-packages + - "18.15.0" ruby: - default_gems_path: '{{ dotfiles_path }}/config/rbenv/default-gems' + default_gems_path: "{{ dotfiles_path }}/config/rbenv/default-gems" # https://www.ruby-lang.org/en/downloads/ versions: - - '3.2.1' - - plugins: - - ianheggie/rbenv-binstubs # A Bundler binstubs Plugin for rbenv - - rbenv/rbenv-default-gems # Automatically install gems every time you install a new version of Ruby - -rust: - components: - - clippy # https://github.com/rust-lang/rust-clippy - - rls # https://github.com/rust-lang/rls - - rust-analysis # https://github.com/rust-lang/rls - - rust-src # https://github.com/rust-lang/rust + - "3.2.1" java: versions: @@ -167,41 +152,7 @@ java: vagrant: boxes: {} - plugins: - - dotenv # https://github.com/johnbellone/vagrant-dotenv ? - - sahara # https://github.com/jedi4ever/sahara - - vagrant-share # https://www.vagrantup.com/docs/share/ - vscode: link: config/vscode/keybindings.json: keybindings.json config/vscode/settings.json: settings.json - - # code --list-extensions | sed -e 's/^/- /g' | pbcopy - extensions: - - TabNine.tabnine-vscode - - Tyriar.sort-lines - - alygin.vscode-tlaplus - - apollographql.vscode-apollo - - christian-kohler.npm-intellisense - - christian-kohler.path-intellisense - - creasty.vscode-altr - - creasty.vscode-pattern-switch - - dbaeumer.vscode-eslint - - eamodio.gitlens - - eg2.vscode-npm-script - - esbenp.prettier-vscode - - formulahendry.auto-close-tag - - formulahendry.auto-rename-tag - - jock.svg - - ms-vsliveshare.vsliveshare - - pflannery.vscode-versionlens - - sleistner.vscode-fileutils - - steoates.autoimport - - streetsidesoftware.code-spell-checker - - styled-components.vscode-styled-components - - swindh.enumerator - - vincaslt.highlight-matching-tag - - wayou.vscode-todo-highlight - - wmaurer.change-case - - wwm.better-align diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index fdafc68a..7942cd48 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -2,6 +2,9 @@ hosts: 127.0.0.1 connection: local + vars: + ansible_python_interpreter: /usr/bin/env python3 + roles: # base #----------------------------------------------- diff --git a/provisioning/roles/flutter/tasks/main.yml b/provisioning/roles/flutter/tasks/main.yml index 4c7f5b09..02705e3b 100644 --- a/provisioning/roles/flutter/tasks/main.yml +++ b/provisioning/roles/flutter/tasks/main.yml @@ -3,8 +3,3 @@ name: flutter state: latest sudo_password: '{{ ansible_become_pass }}' - -- name: install cocoapods - homebrew: - name: cocoapods - state: latest diff --git a/provisioning/roles/golang/tasks/main.yml b/provisioning/roles/golang/tasks/main.yml index a1663fa8..7ea04321 100644 --- a/provisioning/roles/golang/tasks/main.yml +++ b/provisioning/roles/golang/tasks/main.yml @@ -6,9 +6,17 @@ name: go state: latest +- name: install tools (tap) + homebrew_tap: + name: '{{ item }}' + state: present + with_items: + - golangci/tap # for golangci-lint + - name: install tools homebrew: name: '{{ item }}' state: latest - with_items: '{{ golang.tools }}' - when: golang.tools + with_items: + - golangci/tap/golangci-lint # Fast linters runner for Go + - gopls # Language server for the Go language diff --git a/provisioning/roles/homebrew/tasks/main.yml b/provisioning/roles/homebrew/tasks/main.yml index 189925a2..04a41874 100644 --- a/provisioning/roles/homebrew/tasks/main.yml +++ b/provisioning/roles/homebrew/tasks/main.yml @@ -5,20 +5,28 @@ homebrew: update_homebrew: yes -- name: install cask applications +- name: add tap registries + homebrew_tap: + name: '{{ item }}' + state: present + with_items: '{{ homebrew.taps }}' + when: homebrew.taps + tags: install.homebrew.tap + +- name: install casks homebrew_cask: name: '{{ item }}' state: latest accept_external_apps: yes sudo_password: '{{ ansible_become_pass }}' - with_items: '{{ homebrew.applications }}' - when: homebrew.applications + with_items: '{{ homebrew.casks }}' + when: homebrew.casks ignore_errors: yes tags: install.homebrew.cask -- name: install homebrew packages +- name: install formulas homebrew: - name: '{{ homebrew.packages }}' + name: '{{ homebrew.formulas }}' state: latest - when: homebrew.packages + when: homebrew.formulas tags: install.homebrew.formula diff --git a/provisioning/roles/java/tasks/main.yml b/provisioning/roles/java/tasks/main.yml index 88d133f8..07d29ba6 100644 --- a/provisioning/roles/java/tasks/main.yml +++ b/provisioning/roles/java/tasks/main.yml @@ -45,10 +45,10 @@ name: '{{ item }}' state: latest with_items: - - gradle # Open-source build automation tool based on the Groovy and Kotlin DSL - - pre-commit # Framework for managing multi-language pre-commit hooks - - coursier/formulas/coursier # Launcher for Coursier (required by pre-commit) - - kotlin-language-server # Intelligent Kotlin support for any editor/IDE using the Language Server Protocol + - gradle # Open-source build automation tool based on the Groovy and Kotlin DSL + - pre-commit # Framework for managing multi-language pre-commit hooks + - coursier # Launcher for Coursier (required by pre-commit) + - kotlin-language-server # Intelligent Kotlin support for any editor/IDE using the Language Server Protocol # - name: install IDEs # homebrew_cask: @@ -56,5 +56,5 @@ # state: present # with_items: # - intellij-idea-ce -# #- android-sdk -# #- android-studio +# - android-sdk +# - android-studio diff --git a/provisioning/roles/nodejs/tasks/main.yml b/provisioning/roles/nodejs/tasks/main.yml index 68b72d5d..cc9413c6 100644 --- a/provisioning/roles/nodejs/tasks/main.yml +++ b/provisioning/roles/nodejs/tasks/main.yml @@ -16,8 +16,8 @@ git: repo: 'https://github.com/{{ item }}.git' dest: '{{ anyenv.envs_dir }}/nodenv/plugins/{{ item | basename }}' - with_items: '{{ nodejs.plugins }}' - when: nodejs.plugins + with_items: + - nodenv/nodenv-default-packages - name: copy default-packages file: diff --git a/provisioning/roles/ruby/tasks/main.yml b/provisioning/roles/ruby/tasks/main.yml index 70bd986a..95f71a75 100644 --- a/provisioning/roles/ruby/tasks/main.yml +++ b/provisioning/roles/ruby/tasks/main.yml @@ -16,8 +16,9 @@ git: repo: 'https://github.com/{{ item }}.git' dest: '{{ anyenv.envs_dir }}/rbenv/plugins/{{ item | basename }}' - with_items: '{{ ruby.plugins }}' - when: ruby.plugins + with_items: + - ianheggie/rbenv-binstubs # A Bundler binstubs Plugin for rbenv + - rbenv/rbenv-default-gems # Automatically install gems every time you install a new version of Ruby - name: copy default-gems file: @@ -26,7 +27,7 @@ state: link force: yes -- name: install dependency +- name: install dependencies homebrew: name: - libxslt diff --git a/provisioning/roles/rust/tasks/main.yml b/provisioning/roles/rust/tasks/main.yml index 03d2a0e4..a5cca486 100644 --- a/provisioning/roles/rust/tasks/main.yml +++ b/provisioning/roles/rust/tasks/main.yml @@ -17,5 +17,8 @@ - name: install components command: | bash -lc 'rustup component add {{ item }}' - with_items: '{{ rust.components }}' - when: rust.components + with_items: + - clippy # https://github.com/rust-lang/rust-clippy + - rls # https://github.com/rust-lang/rls + - rust-analysis # https://github.com/rust-lang/rls + - rust-src # https://github.com/rust-lang/rust diff --git a/provisioning/roles/vagrant/tasks/main.yml b/provisioning/roles/vagrant/tasks/main.yml index 80ec2931..6dd1417f 100644 --- a/provisioning/roles/vagrant/tasks/main.yml +++ b/provisioning/roles/vagrant/tasks/main.yml @@ -31,5 +31,8 @@ command: | bash -lc 'vagrant plugin install {{ item }}' when: | - vagrant.plugins and installed_plugins.stdout.find(item) == -1 - with_items: '{{ vagrant.plugins }}' + installed_plugins.stdout.find(item) == -1 + with_items: + - dotenv # https://github.com/johnbellone/vagrant-dotenv ? + - sahara # https://github.com/jedi4ever/sahara + - vagrant-share # https://www.vagrantup.com/docs/share/ diff --git a/provisioning/roles/vim/tasks/main.yml b/provisioning/roles/vim/tasks/main.yml index 6addf69e..629e23b9 100644 --- a/provisioning/roles/vim/tasks/main.yml +++ b/provisioning/roles/vim/tasks/main.yml @@ -3,20 +3,19 @@ name: neovim state: latest -- name: install python libraries - pip: - executable: pip3 - name: '{{ item }}' - state: latest - with_items: - - neovim - - name: install dein.vim git: repo: https://github.com/Shougo/dein.vim dest: '{{ dotfiles_path }}/nvim/dein/repos/github.com/Shougo/dein.vim' update: False +- name: install deps via brew (tap) + homebrew_tap: + name: '{{ item }}' + state: present + with_items: + - hashicorp/tap # for terraform-ls + - name: install deps via brew homebrew: name: '{{ item }}' @@ -25,17 +24,16 @@ - ansible-lint - clang-format - deno - - hashicorp/tap/terraform-ls + - terraform-ls - llvm # clangd - shellcheck - watchman -- name: install deps via pip3 - pip: - executable: pip3 - name: '{{ item }}' - state: latest - with_items: - - pynvim - - python-language-server - - vim-vint +#- name: install deps via pip +# pip: +# name: '{{ item }}' +# state: latest +# with_items: +# - pynvim +# - python-language-server +# - vim-vint diff --git a/provisioning/roles/vscode/tasks/main.yml b/provisioning/roles/vscode/tasks/main.yml index 6f8e6e9a..f5edafde 100644 --- a/provisioning/roles/vscode/tasks/main.yml +++ b/provisioning/roles/vscode/tasks/main.yml @@ -53,9 +53,36 @@ bash -lc 'code --list-extensions' register: installed_vscode_exts +# code --list-extensions | sed -e 's/^/- /g' | pbcopy - name: install extensions command: | bash -lc 'code --install-extension {{ item | quote }}' when: | - vscode.extensions and installed_vscode_exts.stdout.find(item) == -1 - with_items: '{{ vscode.extensions }}' + installed_vscode_exts.stdout.find(item) == -1 + with_items: + - TabNine.tabnine-vscode + - Tyriar.sort-lines + - alygin.vscode-tlaplus + - apollographql.vscode-apollo + - christian-kohler.npm-intellisense + - christian-kohler.path-intellisense + - creasty.vscode-altr + - creasty.vscode-pattern-switch + - dbaeumer.vscode-eslint + - eamodio.gitlens + - eg2.vscode-npm-script + - esbenp.prettier-vscode + - formulahendry.auto-close-tag + - formulahendry.auto-rename-tag + - jock.svg + - ms-vsliveshare.vsliveshare + - pflannery.vscode-versionlens + - sleistner.vscode-fileutils + - steoates.autoimport + - streetsidesoftware.code-spell-checker + - styled-components.vscode-styled-components + - swindh.enumerator + - vincaslt.highlight-matching-tag + - wayou.vscode-todo-highlight + - wmaurer.change-case + - wwm.better-align