Skip to content

Instantly share code, notes, and snippets.

@seogi1004
seogi1004 / pom.xml
Last active January 30, 2019 16:07
...
<build>
...
<!-- TODO: jacoco + sonarqube 커버리지 및 코드분석 -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
- stage: backend
language: java
jdk: openjdk8
script:
- mvn install jacoco:report -Dmaven.repo.local=.m2/repository --batch-mode
after_success:
- mvn sonar:sonar -Dsonar.projectKey=seogi1004_vuejs-springboot-starter -Dsonar.organization=seogi1004-github -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN
- stage: patch
language: java
jdk: openjdk8
before_script:
# pom.xml이 변경되지 않았다면 프로세스를 종료함
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep 'pom.xml'
then
echo "Not running CI since only docs were changed."
exit
Patch:
image: maven:3.3.9
only:
changes:
- "pom.xml"
stage: patch
before_script:
- POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
- echo $POM_VERSION
script:
- stage: deploy
language: java
jdk: openjdk8
script:
- POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
after_success:
- ls -all ./dist
- sshpass -V
- export SSHPASS=$SSH_PASSWORD
# SSH 포트가 22가 아니라면 -P 옵션을 줄것
Deploy:
image: maven:3.3.9
stage: deploy
before_script:
- apt-get update -qq && apt-get install -y -qq sshpass
script:
- POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
after_script:
- ls -all ./dist
- sshpass -V
- stage: backend
language: java
jdk: openjdk8
script:
- mvn install -Dmaven.repo.local=.m2/repository --batch-mode
Backend:
image: maven:3.3.9
stage: backend
script:
- mvn install -Dmaven.repo.local=.m2/repository --batch-mode
jobs:
include:
- stage: frontend
language: node_js
node_js:
- "10"
install:
- npm install
script:
- npm test
Frontend:
image: node:10
stage: frontend
before_script:
- npm install
script:
- npm test
after_script:
- npm run dist