Skip to content

inv staging deploy #15

@vkurup

Description

@vkurup

It would be nice to get inv staging deploy to be the only command that a dev needs to memorize to do a deploy (similar to how we used to just do fab staging deploy.

Currently inv staging deploy does this:

$ inv staging deploy
cd deploy/ && ansible-galaxy install -f -r 'requirements.yaml' -p roles/
- changing role caktus.django-k8s from v0.0.5 to v0.0.5
- extracting caktus.django-k8s to /home/vkurup/dev/caktus-website/deploy/roles/caktus.django-k8s
- caktus.django-k8s (v0.0.5) was installed successfully
Traceback (most recent call last):
  File "/home/vkurup/.pyenv/versions/3.7.6/envs/caktus-website/lib/python3.7/site-packages/invoke/config.py", line 111, in __getattr__
    return self._get(key)
  File "/home/vkurup/.pyenv/versions/3.7.6/envs/caktus-website/lib/python3.7/site-packages/invoke/config.py", line 176, in _get
    value = self._config[key]
KeyError: 'tag'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vkurup/.pyenv/versions/3.7.6/envs/caktus-website/bin/inv", line 8, in <module>
    sys.exit(program.run())
  File "/home/vkurup/.pyenv/versions/3.7.6/envs/caktus-website/lib/python3.7/site-packages/invoke/program.py", line 384, in run
    self.execute()
  File "/home/vkurup/.pyenv/versions/3.7.6/envs/caktus-website/lib/python3.7/site-packages/invoke/program.py", line 566, in execute
    executor.execute(*self.tasks)
  File "/home/vkurup/.pyenv/versions/3.7.6/envs/caktus-website/lib/python3.7/site-packages/invoke/executor.py", line 129, in execute
    result = call.task(*args, **call.kwargs)
  File "/home/vkurup/.pyenv/versions/3.7.6/envs/caktus-website/lib/python3.7/site-packages/invoke/tasks.py", line 127, in __call__
    result = self.body(*args, **kwargs)
  File "/home/vkurup/.pyenv/versions/3.7.6/envs/caktus-website/lib/python3.7/site-packages/kubesae/ansible/deploy.py", line 30, in ansible_deploy
    tag = c.config.tag
  File "/home/vkurup/.pyenv/versions/3.7.6/envs/caktus-website/lib/python3.7/site-packages/invoke/config.py", line 123, in __getattr__
    raise AttributeError(err)
AttributeError: No attribute or config key found for 'tag'

Theoretically at least, we could catch that error in ansible/deploy.py line 30, and run the image task. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions