Skip to content

Commit

Permalink
Merge pull request #29 from sfeir-open-source/feat/update-build
Browse files Browse the repository at this point in the history
feat(CI/CD): change the way we build the project
  • Loading branch information
Tony-Proum authored Feb 24, 2019
2 parents 96ad48a + 996e951 commit 849bf8f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 27 deletions.
21 changes: 11 additions & 10 deletions .travis.yml
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
26 changes: 26 additions & 0 deletions Makefile
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}'
17 changes: 0 additions & 17 deletions travis.sh

This file was deleted.

0 comments on commit 849bf8f

Please sign in to comment.