Skip to content

Instantly share code, notes, and snippets.

@remcoboerma
Created January 31, 2023 17:28
Show Gist options
  • Save remcoboerma/12f19a8561a781bc41ef5a9b7ab6dadf to your computer and use it in GitHub Desktop.
Save remcoboerma/12f19a8561a781bc41ef5a9b7ab6dadf to your computer and use it in GitHub Desktop.
Multipass tasks.py for my PycharmProjects folder.
from invoke import task
@task
def mp_up(ctx, omgeving, mp_name='dockers'):
ctx.run(f'multipass exec {mp_name} -d {omgeving} ../.local/bin/invoke up', echo=True)
@task
def mp_remount(ctx, mp_name='dockers'):
if mp_name == 'dockers':
ctx.run(f'multipass unmount {mp_name}:', echo=True)
ctx.run(f'multipass mount reverse_proxy {mp_name}:reverse_proxy', echo=True)
ctx.run(f'multipass mount omgeving {mp_name}:omgeving', echo=True)
ctx.run(f'multipass info {mp_name}', echo=True)
ctx.run(f'multipass exec {mp_name} -d reverse_proxy ../.local/bin/invoke up', echo=True)
@task
def shell(ctx, mp_name='dockers'):
ctx.run(f'multipass shell {mp_name}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment