Mozilla IT Offsite
To present a methodology for continuous integration (CI) and continuous deploymentment (CD) that can be leveraged as a group.
Up and Running
- Clone the code from Github,
- Change directory to the code,
- Open a terminal and execute the command,
- Synchronize your pipenv with changes as they are commited with,
- Synchronize your poetry packages (development and production) with the command,
- Install the git hooks,
- Cut a branch using a git flow or alternative branching strategy and do work.
- Push changes up to Github.
- Observe the status of the related continuous integration on your job.
- Upon completion of the work and a successful build, submit a pull request (PR).
A variety of pre-commit hooks are installed as part of the development workflow. These may be seen in
Secrets Check Hook
There is a secrets check in place to prevent from accident check-in of AWS or other credentials into version control. As a test, you may execute this command and attempt to commit this code:
cat >> credentials <<EOF [commit-test] aws_access_key_id = AKIA1111111111111111 # pragma: allowlist secret aws_secret_access_key = 1111111111111111111111111111111111111111 # pragma: allowlist secret EOF
Next as a test, execute the command,
git add credentials and then make an
git commit -m 'adding a secret'. You will now see this as part of the
Test Driven Devoplement (TDD) and Behavior Drive Development (BDD) tests can be ran with the command,
pytest --cov=./. This not only runs the tests but also creates a coverage
report for the code that you have written. If you do not wish to have a coverage
report then merely omit the argument.
Code quality is measured using CodeCov. This tool tracks code quality over a variety of projections. There is a badge in the header of this
README file that will take you to the hosted site to observe code quality metrics.
Continuous Integration (CI)
This code base utilizes Travis CI for it's CI process. There is a build status badge placed at the top of this
README file to indicate the status of this projects build on the master branch.
Adding An Encrypted CI Secret
Secrets can be added to the CI build job with the following command line expression:
`travis encrypt --add ENVAR_KEY=ENVAR_VALUE`
Running The Application
You can run the application with the command,
Leveraging the Swagger
You may use the Swagger by making a request to
- Install the correct version of Terraform with the command,
- Terraform Documentation
- TravisCI Documentation
- Pipenv Documentation
- Poetry Documentation
- CodeCov Example Repository
- CodeCov Documentation