|
3 | 3 |
|
4 | 4 | # Sonarless v1 |
5 | 5 |
|
6 | | -This action and its developer friendly helper scripts enable sonarqube scanning for your repository without a need of a dedicated hosted sonarqube server. It boots up a sonarqube docker instance and enable developers to scan checkout code and give a metric json so that you can check the quality of the code. |
| 6 | +This developer-friendly CLI and GitHub Action enable SonarQube scanning for your repository without the need for a dedicated hosted SonarQube server. It starts a SonarQube Docker instance, allowing developers to scan code, check results, and generate a JSON metrics file for automation. This ensures you can easily assess and maintain the quality of your code. |
7 | 7 |
|
8 | 8 | # What's new |
9 | 9 |
|
10 | 10 | Please refer to the [release page](https://github.com/gitricko/sonarless/releases/latest) for the latest release notes. |
11 | 11 |
|
12 | | -# Usage |
| 12 | +# Use Sonarless in your Local Dev |
| 13 | + |
| 14 | +To install CLI, paste and run the following in a terminal: |
| 15 | +> `curl -s "https://raw.githubusercontent.com/gitricko/sonarless/main/install.sh" | bash` |
| 16 | +
|
| 17 | +```ssh |
| 18 | + _ |
| 19 | + ___ ___ _ __ __ _ _ __ | | ___ ___ ___ |
| 20 | + / __| / _ \ | "_ \ / _` || "__|| | / _ \/ __|/ __| |
| 21 | + \__ \| (_) || | | || (_| || | | || __/\__ \\__ \ |
| 22 | + |___/ \___/ |_| |_| \__,_||_| |_| \___||___/|___/ |
| 23 | +
|
| 24 | +
|
| 25 | + Now attempting installation... |
| 26 | +
|
| 27 | +Looking for a previous installation of SONARLESS... |
| 28 | +Looking for docker... |
| 29 | +Looking for jq... |
| 30 | +Looking for sed... |
| 31 | +Installing Sonarless helper scripts... |
| 32 | +* Downloading... |
| 33 | +
|
| 34 | +######################################################################## 100.0% |
| 35 | +
|
| 36 | +Please open a new terminal, or run the following in the existing one: |
| 37 | +
|
| 38 | + alias sonarless='/home/runner/.sonarless/makefile.sh' |
| 39 | +
|
| 40 | +Then issue the following command: |
| 41 | +
|
| 42 | + sonarless help |
| 43 | +
|
| 44 | +Enjoy!!! |
| 45 | +``` |
| 46 | +To understand CLI sub-commands, just run `sonarless help` |
| 47 | + |
| 48 | +Usually, you only need to know 2 sub-commands |
| 49 | +- `sonarless scan`: to start scanning your code in the current directory will be uploaded for scanning. When the scan is done, just login webui into your local personal instance of sonarqube via [http://localhost:9234](http://localhost:9234) to get details from SonarQube. The default password for `admin` is `sonarless` |
| 50 | + |
| 51 | +- `sonarless results`: to generate `sonar-metrics.json` metrics file in your current directory |
| 52 | + |
| 53 | +To clean up your sonar instance, just run `sonarless docker-clean`. SonarQube docker instance will be stop and all images removed. |
| 54 | + |
| 55 | +This CLI works perfectly with Github CodeSpace |
| 56 | + |
| 57 | + |
| 58 | +# GitHub Action Usage |
13 | 59 |
|
14 | 60 | <!-- start usage --> |
15 | 61 | ```yaml |
@@ -110,51 +156,6 @@ jobs: |
110 | 156 | sonar-instance-port: '1234' |
111 | 157 | ``` |
112 | 158 |
|
113 | | -# Use Sonarless in your Local Dev |
114 | | - |
115 | | -To install automation scriptlets, paste and run the following in a terminal: |
116 | | -> `curl -s "https://raw.githubusercontent.com/gitricko/sonarless/main/install.sh" | bash` |
117 | | - |
118 | | -```ssh |
119 | | - _ |
120 | | - ___ ___ _ __ __ _ _ __ | | ___ ___ ___ |
121 | | - / __| / _ \ | "_ \ / _` || "__|| | / _ \/ __|/ __| |
122 | | - \__ \| (_) || | | || (_| || | | || __/\__ \\__ \ |
123 | | - |___/ \___/ |_| |_| \__,_||_| |_| \___||___/|___/ |
124 | | - |
125 | | - |
126 | | - Now attempting installation... |
127 | | - |
128 | | -Looking for a previous installation of SONARLESS... |
129 | | -Looking for docker... |
130 | | -Looking for jq... |
131 | | -Looking for sed... |
132 | | -Installing Sonarless helper scripts... |
133 | | -* Downloading... |
134 | | - |
135 | | -######################################################################## 100.0% |
136 | | - |
137 | | -Please open a new terminal, or run the following in the existing one: |
138 | | - |
139 | | - alias sonarless='/home/runner/.sonarless/makefile.sh' |
140 | | - |
141 | | -Then issue the following command: |
142 | | - |
143 | | - sonarless help |
144 | | - |
145 | | -Enjoy!!! |
146 | | -``` |
147 | | -To understand the sub-commands, just run `sonarless help` |
148 | | - |
149 | | -Usually, you only need to know 2 sub-commands |
150 | | -- `sonarless scan`: to start scanning your code in the current directory will be uploaded for scanning. When the scan is done, just login webui into your local personal instance of sonarqube via [http://localhost:9234](http://localhost:9234) to get details from SonarQube. The default password for `admin` is `sonarless` |
151 | | - |
152 | | -- `sonarless results`: to generate `sonar-metrics.json` metrics file in your current directory |
153 | | - |
154 | | -To clean up your sonar instance, just run `sonarless docker-clean`. SonarQube docker instance will be stop and all images removed. |
155 | | - |
156 | | -This small scriptlet works perfectly with Github CodeSpace |
157 | | - |
158 | 159 | # Coffee |
159 | 160 |
|
160 | 161 | If you find this small helper script and action helpful, buy me a [sip of coffee](https://ko-fi.com/gitricko) here to show your appreciation (only if you want to) |
0 commit comments