-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (57 loc) · 2.47 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# you need to use make
.PHONY: ps build rebuild up start fresh stop restart down destroy
CONTAINER_SONAR=sonarqube
CONTAINER_DATABASE=db_postgres-database
VOLUME_DATABASE_DATA=vgel_sonarqube_postgres_database_data
VOLUME_BUNDLED_PLUGINS=vgel_sonarqube_sonarqube_bundled-plugins
VOLUME_CONF=vgel_sonarqube_sonarqube_conf
VOLUME_DATA=vgel_sonarqube_sonarqube_data
VOLUME_DATABASE=vgel_sonarqube_postgres_database
VOLUME_EXTENSIONS=vgel_sonarqube_sonarqube_extensions
VOLUME_LOGS=vgel_sonarqube_sonarqube_logs
ps: ## Show containers
@docker compose ps
build: ## Build all containers
@docker compose-build
rebuild: ## run the rebuild.sh file
@./rebuild.sh
up: ## Builds, (re)creates, and starts containers
@docker-compose up
start: ## Start all containers
@docker compose start
fresh: stop destroy build start ## Destroy & recreate all containers
stop: ## Stop all containers
@docker compose stop
down: ## Stop and remove all containers
@docker compose down
restart: stop start ## Restart all containers
destroy: stop ## Destroy all containers
@docker compose down
@if [ "$(shell docker volume ls --filter name=${VOLUME_DATABASE_DATA} --format {{.Name}})" ]; then \
docker volume rm ${VOLUME_DATABASE_DATA}; \
fi
@if [ "$(shell docker volume ls --filter name=${VOLUME_BUNDLED_PLUGINS} --format {{.Name}})" ]; then \
docker volume rm ${VOLUME_BUNDLED_PLUGINS}; \
fi
@if [ "$(shell docker volume ls --filter name=${VOLUME_CONF} --format {{.Name}})" ]; then \
docker volume rm ${VOLUME_CONF}; \
fi
@if [ "$(shell docker volume ls --filter name=${VOLUME_DATA} --format {{.Name}})" ]; then \
docker volume rm ${VOLUME_DATA}; \
fi
@if [ "$(shell docker volume ls --filter name=${VOLUME_DATABASE} --format {{.Name}})" ]; then \
docker volume rm ${VOLUME_DATABASE}; \
fi
@if [ "$(shell docker volume ls --filter name=${VOLUME_EXTENSIONS} --format {{.Name}})" ]; then \
docker volume rm ${VOLUME_EXTENSIONS}; \
fi
sonar-install: ## Install SonarScanner last version
./scripts/install-sonar-scanner.sh
sonar-scan: ## Run SonarScanner last version
/var/opt/sonar-scanner-4.8.0.2856-linux/bin/sonar-scanner \
-Dsonar.projectKey=vgel \
-Dsonar.sources=. \
-Dsonar.sourceEncoding=utf-8 \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.login=sqp_a7e04af8e31483801502c77884e452a4ff1ce260 \
-Dsonar.exclusions=vgel/node_modules/**,vgel/vendor/**,vgel/public/bootstrap/**/*.css,vgel/public/css/**/*.css,vgel/public/css/**/*.less