-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
Document adding a job to GitLab CICD #1086
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,3 +121,24 @@ Then run ``pre-commit install`` and you're ready to go. | |
.. _pre-commit: https://pre-commit.com/ | ||
.. _have it installed: https://pre-commit.com/#install | ||
.. _`real git tag/revision`: https://github.com/PyCQA/bandit/releases | ||
|
||
GitLab CI/CD integration | ||
------------------ | ||
|
||
To integrate Bandit with `GitLab continuous integration and delivery (CI/CD)`_, | ||
use a job like so: | ||
|
||
.. code-block:: yaml | ||
|
||
bandit: | ||
cache: {} | ||
image: | ||
name: cytopia/bandit:1-py3.10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Good addition. Looking at this though, makes me realise we should really start producing our own images, just in case cytopia/bandit:1-py3.10 were to fall into bad hands. I will raise an issue, but until then let's keep this PR open. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello, @lukehinds! Thanks for considering this contribution. Yes, I also noticed that using the cytopia image is suboptimal and first-party Docker images would be preferable. By adding this job to the documentation, users might get encouraged to trust the source of the image. I have subscribed to the issue about creating such an image, so I can update this PR with the image name. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now have official images: https://github.com/PyCQA/bandit?tab=readme-ov-file#container-images There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, please switch the official Bandit image. |
||
entrypoint: [""] | ||
script: | ||
- bandit --configfile pyproject.toml -r my_package/ | ||
stage: lint_static | ||
|
||
> **NOTE**: Adapt the package name from `my_package` to your package name. | ||
|
||
.. _GitLab continuous integration and delivery (CI/CD): https://docs.gitlab.com/ee/ci/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.