Skip to content
Snippets Groups Projects
Select Git revision
  • 8335e2b1f5b42984718a89fe250d2f3565d12604
  • master default
2 results

_vagrant-update

Blame
    • nimrod's avatar
      8335e2b1
      A commit that's just too big. · 8335e2b1
      nimrod authored
      Too many changes in one commit that aren't relevant to each other all
      because I didn't commit these for some time and they piled up, exactly
      what I shouldn't do.
      
      - Remove some Git submodules. They're not needed.
      - Remove the REPREPRO_BASE_DIR environment variable, it's set with
      direnv inside that project.
      - Use Docker Buildkit.
      - Use auto Python interpeter with Ansible, prefer Python3.
      - Better ls aliases.
      - Netcat aliases to listen and check ports and sockets.
      - Aliases and functions for Terraform.
      - Use Black to format Python code.
      - Show the run duration and exit code in a line before the prompt, maybe
      better with Bash earlier than 5.0, where there's an annoying with line
      wrapping.
      - Valid name for the flatpak_kill shell function.
      - Delete user-dirs files, didn't do anything anyway.
      - Convert README from reStructuredText to Markdown.
      - Don't install gsutil with Python2, use snap to install the Google SDK.
      - More pre-commit hooks, update the exiting ones, format the file for
      yamllint, Use flake8 from it's repo, the one from the hooks repo is
      deprecated.
      - Clean the Shore SSH config.
      - Add the shared AWS keys to the Endless SSH config.
      8335e2b1
      History
      A commit that's just too big.
      nimrod authored
      Too many changes in one commit that aren't relevant to each other all
      because I didn't commit these for some time and they piled up, exactly
      what I shouldn't do.
      
      - Remove some Git submodules. They're not needed.
      - Remove the REPREPRO_BASE_DIR environment variable, it's set with
      direnv inside that project.
      - Use Docker Buildkit.
      - Use auto Python interpeter with Ansible, prefer Python3.
      - Better ls aliases.
      - Netcat aliases to listen and check ports and sockets.
      - Aliases and functions for Terraform.
      - Use Black to format Python code.
      - Show the run duration and exit code in a line before the prompt, maybe
      better with Bash earlier than 5.0, where there's an annoying with line
      wrapping.
      - Valid name for the flatpak_kill shell function.
      - Delete user-dirs files, didn't do anything anyway.
      - Convert README from reStructuredText to Markdown.
      - Don't install gsutil with Python2, use snap to install the Google SDK.
      - More pre-commit hooks, update the exiting ones, format the file for
      yamllint, Use flake8 from it's repo, the one from the hooks repo is
      deprecated.
      - Clean the Shore SSH config.
      - Add the shared AWS keys to the Endless SSH config.
    _vagrant-update 665 B
    #!/usr/bin/env python3
    
    from sh import vagrant
    from parse import parse
    
    
    boxes = {}
    dummy_providers = ["aws"]
    for line in vagrant.box("list"):
        box = parse("\x1b[0m{name:^} ({provider}, {version})\x1b[0m", line)
        if not box["provider"] in dummy_providers:
            if box["name"] in boxes:
                if not box["provider"] in boxes[box["name"]]:
                    boxes[box["name"]].append(box["provider"])
            else:
                boxes[box["name"]] = [box["provider"]]
    for box in boxes:
        for provider in boxes[box]:
            print("Updating box {0} provider {1}.".format(box, provider))
            vagrant.box("update", "--provider", provider, "--box", box)