-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from upfluence/mb/VEL-1857
Enable sonarqube on ember-brand-manager
- Loading branch information
Showing
9 changed files
with
307 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.PHONY: start | ||
|
||
.EXPORT_ALL_VARIABLES: | ||
|
||
SHELL := /bin/bash | ||
PORT := 0 | ||
ENV := development | ||
|
||
all: clear echo start ## Starts the dev server | ||
|
||
clear: | ||
@clear | ||
|
||
install: ## Runs 'pnpm' to install dependencies | ||
@echo 'Installing dependencies' | ||
pnpm install | ||
@echo ""; echo "-------------------------------"; echo "" | ||
|
||
echo: | ||
@echo Starting ember-brand-manager | ||
|
||
start: | ||
ember s --port $(PORT) --environment ${ENV} | ||
|
||
build: | ||
ember build --environment ${ENV} | ||
|
||
clean: ## Cleans ./node_modules && ./dist | ||
@echo "Cleaning up ./node_modules & ./dist folders" | ||
-rm -r ./node_modules | ||
-rm -r ./dist | ||
@echo ""; echo "-------------------------------"; echo "" | ||
|
||
re: clean install echo start ## Reinstalls dependencies & starts the dev server | ||
|
||
help: clear ## Displays the help message | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
h: help ## Displays the help message | ||
|
||
version_patch: ## Creates & pushes a new patch tag | ||
./scripts/new-version-tag patch | ||
|
||
version_minor: ## Creates & pushes a new minor tag | ||
./scripts/new-version-tag minor | ||
|
||
version_major: ## Creates & pushes a new major tag | ||
./scripts/new-version-tag major | ||
|
||
sonar-report: ## Runs a bunch of commands that will finally lead to a new report in sonarqube | ||
./scripts/generate_sonar_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
## This script automates the flow to generate a new activity report in sonarqube | ||
|
||
echo "[Generating a sonar report.]" | ||
echo "" | ||
echo "" | ||
|
||
## Check that sonarqube property file exists | ||
echo "[Step1] Check for sonar-project.properties file existence:" | ||
if test -f "./sonar-project.properties"; then | ||
echo "File exists." | ||
else | ||
echo "File is missing. Check your configuration." | ||
exit 1 | ||
fi | ||
|
||
## Run ember test & generate code coverage with [ember-cli-code-coverage] | ||
echo "" | ||
echo "" | ||
echo "[Step2] Run ember test - dot reporter to generate lcovinfo file" | ||
COVERAGE=true ember test | ||
|
||
## Check that coverage folder has been generated | ||
echo "" | ||
echo "" | ||
echo "[Step3] Check that coverage folder has been generated" | ||
if [ -d "./coverage" ]; then | ||
echo "./coverage directory successfully created." | ||
else | ||
echo "./coverage directory not found. Check your configuration." | ||
exit 1 | ||
fi | ||
|
||
## Run sonar-scanner with the proper project version | ||
echo "" | ||
echo "" | ||
echo "[Step4] Run sonar-scanner" | ||
sonar-scanner -D sonar.projectVersion=$(git describe --tags --abbrev=0) -Dsonar.login=$SONARCLOUD_FRONTEND_TOKEN | ||
|
||
echo "[Success]" |
Oops, something went wrong.