Skip to main content

A simple tool to validate if a repository adhears to specified rules.

Project description

cmply

PyPI version Supported Python versions PyPI downloads Licence

Installation

python3 -m pip install --upgrade cmply

Introduction

Cmply is a tool used to run a set of rules against a repository. The output will show the result of what rules fail or pass. There is provision for different levels of failures. These levels are info, warning, fail and security. The target can be a local folder or a git repository. If a git repository is specified, the local git is used with any configure authentication relative to the local system.

Usage

usage: cmply run [-h] [-r RULES] [-v] [-f] [--no-error] [-t TAGS] [-e ENV] [--output {json}] [-b BRANCH] target

positional arguments:
  target                the target folder or git repo to run the compliance check on

options:
  -h, --help            show this help message and exit
  -r RULES, --rules RULES
                        glob of rule files
  -v, --verbose         increase output verbosity
  -f, --hide-fail       hide failure out information
  --no-error            dont exit 1 if security and fails are found
  -t TAGS, --tags TAGS  project tags
  -e ENV, --env ENV     environmental variables
  --output {json}       output type
  -b BRANCH, --branch BRANCH
                        the branch to use if target is a git repo

Rule file

The rules files are YAML files with the following format:

name: sonarcube-setup   # Name your rule here
description: |          # This is a verbose description
  All projects must be registered in sonarcube
image: node:16          # Your steps are executed in this docker container
type: fail              # The type of rule info, warning, fail or security
tags:                   # A list of tags. These then matched to the tags passed in from the command line for your execution.
  - all
steps:                  # A list of commands executed. When a command has a non 0 response- the test is considered failed
  - test -f sonar-project.properties

Run using docker

To use the docker image of cmply it is important to pass through the hosts docker socket.

docker run \
    -v //var/run/docker.sock:/var/run/docker.sock
    -v ./rules:/opt/rules
    -v ./target:/opt/target
    -ti pselibas/cmply \
    run -r /opt/rules \
    /opt/target

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmply-0.1.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmply-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file cmply-0.1.1.tar.gz.

File metadata

  • Download URL: cmply-0.1.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.6 Windows/10

File hashes

Hashes for cmply-0.1.1.tar.gz
Algorithm Hash digest
SHA256 11150011654eb3aed3f7a01ca760c4ec4bfaf6f28db28c2d8c256bb2ac6bea26
MD5 4ea5d9b2407f6709e007b32bf2b5b17c
BLAKE2b-256 03e41c769e42503b50bf75011e6917d17ebb2a97d3f2dd75615e8d78fba65f9b

See more details on using hashes here.

File details

Details for the file cmply-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cmply-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.6 Windows/10

File hashes

Hashes for cmply-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eecd608c55955a335c41393ee2c83eddb8832de511f0035e74aaa06b6a2d95a8
MD5 1ea3ba12a9223bb59c424e9c70af3782
BLAKE2b-256 f4f850e0df550973f5bc5b9ada83a8df53d335c7f724ec32b166e5171f3a0e94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page