-
Notifications
You must be signed in to change notification settings - Fork 24
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 #29 from sfeir-open-source/feat/update-build
feat(CI/CD): change the way we build the project
- Loading branch information
Showing
3 changed files
with
37 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
services: docker | ||
language: java | ||
sudo: false | ||
|
||
jdk: | ||
- oraclejdk8 | ||
- openjdk8 | ||
jobs: | ||
include: | ||
- stage: "Test & Quality Checks" | ||
install: skip # bundle install is not required | ||
include: | ||
script: make run-test | ||
- script: make quality-analysis | ||
- stage: deploy | ||
install: skip # bundle install is not required | ||
script: make deploy-package | ||
|
||
install: true | ||
script: ./travis.sh | ||
|
||
cache: | ||
directories: | ||
- '$HOME/.m2/repository' | ||
|
||
notifications: | ||
email: false |
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,26 @@ | ||
run-test: ## Allows to run all unit tests | ||
@docker run --mount type=bind,src=$$(pwd),target=/usr/src -w /usr/src maven:alpine mvn test | ||
|
||
build-package: ## Allows to build artifacts | ||
@docker run --mount type=bind,src=$$(pwd),target=/usr/src -w /usr/src maven:alpine mvn package | ||
|
||
quality-analysis: build-package ## Allows to run static quality analyis | ||
@docker run --mount type=bind,src=$$(pwd),target=/usr/src -w /usr/src maven:alpine mvn sonar:sonar \ | ||
-Dsonar.host.url=$$SONAR_HOST_URL \ | ||
-Dsonar.login=$$SONAR_TOKEN \ | ||
-Dsonar.projectVersion=$$CURRENT_VERSION \ | ||
-Dsonar.projectKey=$$SONAR_PROJECT_KEY \ | ||
-Dsonar.organization=$$SONAR_ORGANIZATION \ | ||
-Dsonar.analysis.buildNumber=$$TRAVIS_BUILD_NUMBER \ | ||
-Dsonar.analysis.pipeline=$$TRAVIS_BUILD_NUMBER \ | ||
-Dsonar.analysis.sha1=$$TRAVIS_COMMIT \ | ||
-Dsonar.analysis.repository=$$TRAVIS_REPO_SLUG | ||
|
||
deploy-package: ## Allows to deploy artifacts to our registry | ||
@echo "Not implemented yet" | ||
|
||
|
||
.DEFAULT_GOAL := help | ||
.PHONY: test help | ||
help: | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |