Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User defined plugin deployment order selection #367

Closed
LeoDiazL opened this issue Nov 24, 2022 · 4 comments · Fixed by #413
Closed

User defined plugin deployment order selection #367

LeoDiazL opened this issue Nov 24, 2022 · 4 comments · Fixed by #413

Comments

@LeoDiazL
Copy link
Contributor

LeoDiazL commented Nov 24, 2022

Nowadays we have a pretty static definition of what to run and when in Bitops.

Even though I know the order can be changed by doing some mods, I think it would be nice to do something that could adapt easily to what the user needs.
I can think of more than one scenario where I would like to run some Ansible playbooks before running Terraform for example, but would like to run an Ansible playbook post terraform excecution too.

I can think of two approaches.

  • Folder based order. Simple 0 --> Z
  • File definition with the order this folders should be read.

We can populate the deployments list by just listing the directories available inside the deployment, and then read which plugin is needed based on the bitops.config.yaml


Slack discussion: https://bitovi.slack.com/archives/C0129U3GL93/p1669301822079609

@arm4b arm4b changed the title User defined plugin order selection User defined plugin deployment order selection Nov 24, 2022
@arm4b
Copy link
Member

arm4b commented Nov 24, 2022

From the discussion, the following projects were mentioned where user can control the order of runs in the workflow config:

Per @PhillypHenning :

YAML deployment order control via root-level bitops.config.yaml:

deployments:
    ansible_first:
      plugin: ansible
    terraform:
      plugin: terraform
    ansible_final:
      plugin: ansible

Alphanumeric dir name order in bitops.config.yaml via option:

deployment_order: alphanum
deployments: {}

User names the deployment dirs like 00_ansible, 01_terraform, 02_ansible, or similar.

@arm4b
Copy link
Member

arm4b commented Nov 24, 2022

Speaking of UX, if going with the YAML config definition, it could consistently work together with a Feature: Run a Deployment sub-step CLI #318.
For instance, having this bitops config:

deployments:
  prepare-instance:
    plugin: ansible
  terraform-provision:
    plugin: terraform
  setup-instance:
    plugin: ansible

Based on the named deployment definitions, we could potentially provide an option to nicely run the deployment sub-step in CLI like this:

$ <docker_cmd> bitops run prepare-instance
$ <docker_cmd> bitops run terraform-provision
$ <docker_cmd> bitops run setup-instance

@mickmcgrath13
Copy link
Contributor

mickmcgrath13 commented Nov 29, 2022

@LeoDiazL @armab is this a duplicate of #259 ?

@arm4b
Copy link
Member

arm4b commented Nov 29, 2022

Good find on
Duplicate of #259

Let's close it in favor of the original one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants