|
|
|
## Code style check container.
|
|
|
|
|
|
|
|
1. Installing docker. Open up a new Terminal by pressing `Ctrl` + `Alt` + `t`
|
|
|
|
```sh
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install git
|
|
|
|
git clone https://gitlab.iotiot.in/newbies/pre-office-office/docker-containers.git
|
|
|
|
cd docker-containers
|
|
|
|
sudo install-docker-ubuntu-16.04.sh
|
|
|
|
```
|
|
|
|
- **Note:** The script will automatically install and **reboot** your system.
|
|
|
|
- **Note:** These steps only work on Ubuntu 16.04 OS. Any other OS will cause an error.
|
|
|
|
|
|
|
|
- After the system reboots, Open up a new Terminal by pressing `Ctrl` + `Alt` + `t`.
|
|
|
|
- Run command `sudo docker --version` to verify that docker is successfully installed.
|
|
|
|
```sh
|
|
|
|
# The output should be a docker version
|
|
|
|
$ sudo docker --version
|
|
|
|
Docker version 19.03.13, build 4484c46d9d
|
|
|
|
```
|
|
|
|
2. Start docker container by running command, in the same terminal
|
|
|
|
```sh
|
|
|
|
cd docker-containers/coding-style-container
|
|
|
|
sudo ./start
|
|
|
|
```
|
|
|
|
3. You will get a new Terminal prompt,
|
|
|
|
![terminal](upload/Selection_018.png)
|
|
|
|
|
|
|
|
4. Clone the project repository
|
|
|
|
```sh
|
|
|
|
git clone {your-project-repo}
|
|
|
|
cd {your-project-name}
|
|
|
|
```
|
|
|
|
For example: Lets say your project repository is `https://gitlab.iotiot.in/newbies/pre-office-office/devops-trial.git` then the steps are
|
|
|
|
```sh
|
|
|
|
git clone https://gitlab.iotiot.in/newbies/pre-office-office/devops-trial.git
|
|
|
|
cd devops-trial
|
|
|
|
```
|
|
|
|
|
|
|
|
5. Check for vulnerabilities using **flawfinder**, run command
|
|
|
|
```sh
|
|
|
|
flawfinder {folder-which-contains-your-code}
|
|
|
|
```
|
|
|
|
|
|
|
|
6. Check for MISRA C/CPP violations, run commands
|
|
|
|
```sh
|
|
|
|
cppcheck cppcheck --dump --quiet {folder-which-contains-your-code}/*
|
|
|
|
python3 /usr/share/cppcheck/addons/misra.py {folder-which-contains-your-code}/*.dump
|
|
|
|
``` |
|
|
|
\ No newline at end of file |