Victoria Plugin that allows the creation and DESTRUCTION of Glasswall Email on the cloud.
Project description
Victoria GWEmail Rebuilder
Victoria Rebuilder is a V.I.C.T.O.R.I.A is a plugin that allows you to run multiple Azure DevOps release pipelines
Features
- Run 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
User guide
Prerequisites
- Python 3.9
- Pip
- Victoria
Installation
$ pip install -U victoria_rebuilder
Operation
Configuration
There is an example configuration file provided, please update it as you see fit using the guidance below.
Access Configuration
access:
access_token: <encoded>
organisation: Organisation
project: Azure DevOps Project
email: user@organisation.com
access_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 values
In the config, the access_token
which belongs to the access
section should contain encrypted data. This can be
achieved with the pre-build victoria encrypt
command. Details on this
can be found in the documentation:
- Make sure you've set up your Victoria cloud encryption backend.
- Paste the required value (i.e. the
access_token
) into the following Victoria command like:$ victoria encrypt data <access_token>
- The command should output a YAML object containing fields
data
,iv
,key
andversion
. This is the encrypted value string and can be safely stored in config. Put this YAML object into youraccess
section like:access: access_token: data: <snip> iv: <snip> key: <snip> version: <snip> organisation: Glasswall project: SomeProject email: some@email.com
Deployment Configuration
deployments:
stage: deploy_init_infrastructure
releases:
- name: Platform.Infrastructure
stage: deploy_kubernetes_infrastructure
releases:
- name: Platform.Kubernetes
stage
: 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 DevOps
Help text
Usage: 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 Examples
Rebuild an environment
Rebuild is defined as running the release pipelines associated with the stage pent
in this example.
victoria rebuilder rebuild pent
Copy an environment
Copy 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 perf
Would copy the status of qa to pent and perf
Contribution
Bug reports
You can submit a bug report here.
Feature requests
You can request a new feature here.
Vulnerability reports
We 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 requests
We accept pull requests! To contribute:
- Pick up an unassigned issue from our 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 (like
rework-fancy-integrator
). - Follow the Google style guide for Python.
We use pylint to 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 use yapf to 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 use the imperative mood in commit message subjects.
- 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.
- The CI build will run for 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 SonarCloud.
- Someone will review your pull request and suggest changes if necessary.
- When everything is signed off, your pull request will be merged! Congrats.
Developer guide
Prerequisites
- Python 3.9
- Pipenv
Quick start
- Clone this repo.
- Run
pipenv sync
- You're good to go. You can run commands using the package inside a
pipenv shell
, and modify the code with your IDE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file victoria_gwemail_rebuilder-0.0.2.tar.gz
.
File metadata
- Download URL: victoria_gwemail_rebuilder-0.0.2.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6144e67bb4957ffcd06d273bcbe5c8b4943e3c6ae67a53f754b7c06537bddeb |
|
MD5 | 095e6a228a3d57dab00e8a8a5f67c224 |
|
BLAKE2b-256 | 978f3f91fcc5ef80ce30078e0a4da266439c916cd78554e8ad595e91b071e9e0 |
File details
Details for the file victoria_gwemail_rebuilder-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: victoria_gwemail_rebuilder-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b68a1c2cf9c3ade64115eb8e3239cd1db2dc0022caee4ac209eb3d3e34126a03 |
|
MD5 | 6d77ea3dcb0302afddda67b502048402 |
|
BLAKE2b-256 | 29151a2c5539471fce432d5daabb3726ce13fa07bdd8d78d24b13910c13e257e |