Package: victoria-rebuilder
Victoria RebuilderVictoria Rebuilder is a V. I. C. T. O. R. I. A is a plugin that allows you to run multiple Azure DevOps release pipelinesFeaturesRun a series of release pipelines based on a stages most recent successful releases in Azure DevOps.Run a series of release pipelines for a stage based off another stage's most recent successful releases in Azure DevOps.PrerequisitesPython 3.7+PipPipenvInstallationpipenv install -U victoria_rebuilderUsageConfigThere is anexample configurationfile provided please update it as you see fit using the guidance below.Access Configurationaccess:access_token:<encoded>organisation:Organisationproject:Azure DevOps Projectemail:user@organisation.comaccess_token: The PAT token associated to the email and organisation. The PAT Token must have Read and Write access to Releases.organisation: The organisation in Azure DevOps.project: The project in Azure DevOpsemail: The email account associated to the PAT token.Encrypting data for config valuesIn the config, theaccess_tokenwhich belongs to theaccesssection should contain encrypted data. This can be
achieved with the pre-buildvictoria encryptcommand. Details on this
can be found inthe documentation:Make sure you've set up yourVictoria cloud encryption backend.Paste the required value (i.e. theaccess_token) into the following Victoria command like:$ victoria encrypt data <access_token>The command should output a YAML object containing fieldsdata,iv,keyandversion.
This is the encrypted value string and can be safely stored in config.
Put this YAML object into youraccesssection like:access:access_token:data:<snip>iv:<snip>key:<snip>version:<snip>organisation:Glasswallproject:SomeProjectemail:some@email.comDeployment Configurationdeployments:stage:deploy_init_infrastructurereleases:-name:Platform.Infrastructurestage:deploy_kubernetes_infrastructurereleases:-name:Platform.Kubernetesstage: Name of the stage. The releases in each stage are all run first before the next stage is completereleases: List of releases and their name. The name is the name of the release in Azure DevOpsHelp textUsage: victoria rebuilder [OPTIONS] COMMAND [ARGS]...

  The rebuilder allows the destruction and rebuilding of environments via
  CLI.

Options:
  -h, --help  Show this message and exit.

Commands:
  copy     CLI call for rebuilding an environment based off another...
  optional flags:
      -r, ---resume     If you want the rebuilder to use the previous state file.

  rebuild  CLI call for rebuilding a specific kubernetes environment...
  optional flags:
      -r, ---resume     If you want the rebuilder to use the previous state file.
      -a, --auto-retry  If a release fails to deploy, instead of prompting the user 
                        for a y/n on retry, it automatically retries the deployment.CLI ExamplesRebuild an environmentRebuild is defined as running the release pipelines associated with the stagepentin this example.victoria rebuilder rebuild pentCopy an environmentCopy is defined as running the release for a stage based of an other stage. The use case for this is if you created a new stage and want it to have the same release version as the dev stage.python rebuilder copy qa pent perfWould copy the status of qa to pent and perfContributionBug reportsYou can submit a bug report here.Feature requestsYou can request a new feature here.Vulnerability reportsWe prefer vulnerabilities to be reported in private so as to minimise their
impact (so we can fix them before they are exploited!). To this end, please
email any security vulnerability reports to 'sre@glasswallsolutions.com'.
We would appreciate it if you use the issue template in the link below.
All vulnerabilities will be acknowledged within one business day.You can publicly report a security vulnerability here.Pull requestsWe accept pull requests! To contribute:Pick up an unassigned issue fromour issue board.Assign yourself to the issue so other people know you're working on it.Work on your code in a feature branch that's got a descriptive name (likerework-fancy-integrator).Follow theGoogle style guide for Python.We usepylintto lint our code.
We run pylint without the 'convention' and 'refactor' message classes.
You can lint your code with:pipenv run pylint victoria_destroyer --disable="C,R".
We useyapfto automatically format our code. We recommend having it
format the code whenever you save.Make commits for each part of your pull request. Try not to make too many (if it's a small issue you may only need one).We try to usethe imperative moodin commit message subjects.We expect all new code to have at least 80% test coverage. This is enforced byCodecov.To run tests locally and check coverage, use:pipenv run pytest tests/ --cov=victoria_rebuilder.When ready to merge, create a pull request from your branch into master.Make sure you link your pull request to the issue(s) it addresses.TheCI buildwill runfor your pull request. If it fails then it cannot be merged. Inspect the output, figure
out why it failed, and fix the problem.
The CI build will lint your code, run tests, and send coverage/code to Codecov
andSonarCloud.Someone will review your pull request and suggest changes if necessary.When everything is signed off, your pull request will be merged! Congrats.DevelopmentPrerequisitesPython 3.xPipenvQuick startClone this repo.Runpipenv syncYou're good to go. You can run commands using the package inside apipenv shell, and modify the code with your IDE.LicenseVictoria Rebuilder is licensed under the MIT license.