maven .travis.yml
travis 를 사용해서 CI/CD 중 CI 만 해본다. 책에서 .travis.yml 을 생성해서 travis CI 의 설정을 해보기로 했다. 책과 다르게 나는 메이븐으로 설정해서 아래 부분 중에 scripts부분을 mvn clean install로 변경했다.
language: java
jdk:
- openjdk8
branches:
only:
- master
# Travis CI 서버의 Home
cache:
directories:
- '$HOME/.m2/repository'
script: "mvn clean package"
# CI 성공시 이메일로 알림
notifications:
email:
recipients:
- {본인 이메일}
돌렸더니 잘 된다..
~~ 앞부분 생략 ~~
$ git clone --depth=50 --branch=master https://github.com/eojin312/fl-springboot.git eojin312/fl-springboot
~~ 중략 ~~
$ cd eojin312/fl-springboot
$ git checkout -qf 8c04386617d2a98345ec81a071b1653ff166f038
~~ 중략 ~~
Setting up build cache
$ java -Xmx32m -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~16.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
$ javac -J-Xmx32m -version
javac 1.8.0_242
install
$ ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< hachi:fl-springboot >-------------------------
[INFO] Building fl-springboot 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from apache-snapshots: https://repository.apache.org/snapshots/net/minidev/json-smart/maven-metadata.xml
Downloading from sonatype: https://oss.sonatype.org/content/repositories/releases/net/minidev/json-smart/maven-metadata.xml
Downloading from sonatype-apache: https://repository.apache.org/content/repositories/releases/net/minidev/json-smart/maven-metadata.xml
~~ 중략 ~~
[INFO] --- maven-jar-plugin:3.1.2:jar (default-jar) @ fl-springboot ---
[INFO] Building jar: /home/travis/build/eojin312/fl-springboot/target/fl-springboot-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.2.4.RELEASE:repackage (repackage) @ fl-springboot ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.790 s
[INFO] Finished at: 2020-03-10T08:35:12Z
[INFO] ------------------------------------------------------------------------
The command "mvn clean package" exited with 0.
cache.2
store build cache
Done. Your build exited with 0.
요약해보면 총 6개의 명령을 실행했다.
- git clone
- source directory로 이동
- git checkout
- java version 확인
- ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- mvn clean install