Within each tool directory, you can optionally have a bitops.before-deploy.d/ and/or a bitops.after-deploy.d/. If any shell scripts exist within these directories, bitops will execute them first.
This is a useful way to extend the functionality of bitops. A popular usecase we've seen is loading secrets or dynamically editing bitops.config.yml
A single run of BitOps will:
Copies the contents of /opt/bitops_deployment to a temporary working directory.
Attempts to setup a cloud provider (AWS) using the credentials passed in at container execution time.
If a terraform/ directory exists within the selected environment:
- Run any
bitops.before-deploy.d/*.shscripts - Load
bitops.config.ymland set environment - Merge contents with Default environment - TODO
- Select terraform version
- Run
terraform init - Select
terraform workspace - Run
terraform plan - Run
terraform applyorterraform destroy - Run any
bitops.after-deploy.d/*.shscripts
If an ansible/ directory exists within the selected environment:
- Run any
bitops.before-deploy.d/*.shscripts - Load
ansible/extra_envenvironment config file if exists - Load
bitops.config.ymland set environment - Merge contents with Default environment - TODO
- Run
ansible-playbook $playbookfor each*.yamlor*.ymlfile in$env/ansible/ - Run any
bitops.after-deploy.d/*.shscripts
If a helm/ directory exists within the selected environment:
- Run the following for
$env/helm/$ENVIRONMENT_HELM_SUBDIRECTORY/or for all charts in$env/helm/ - Run any
bitops.before-deploy.d/*.shscripts - Load
bitops.config.ymland set environment - Merge contents with Default environment
- Use
$KUBE_CONFIG_PATHif defined, if not use aws cli to build .kubeconfig - Gather all values files - TODO document
- Run
helm dep up - Run
helm upgradeorhelm install - Run
helm rollbackon failure - Run any
bitops.after-deploy.d/*.shscripts - TODO
helm_install_external_chartsandhelm_install_charts_from_s3never run!
If a cloudformation/ directory exists within the selected environment:
- Run any
bitops.before-deploy.d/*.shscripts - Load
bitops.config.ymland set environment - Merge contents with Default environment - TODO
- Run cfn template validation
- Create or delete cfn stack. Wait for completion
- Run any
bitops.after-deploy.d/*.shscripts
