If I hope GitLab can build a WAR file when I commit source code, how to do it?
I am using Maven 3 and JDK 7 in eclipse, and using mvn clean package -U to build WAR file in eclipse.
How-To
Step 1. Add .gitlab-ci.yml to the root directory of my project, the content looks like:
1 2 3 4 5 6 7 8 9 10 | image: maven:3-jdk-7 build: stage: build script: "mvn clean package -U" artifacts: expire_in: 1 week when: always paths: - target/*.war |
Step 2. Add, commit and Push .gitlab-ci.yml to GitLab
Step 3. Seeing the status of your pipeline and jobs
Reference
[1] https://docs.gitlab.com/ce/ci/quick_start/README.html
[2] https://hub.docker.com/r/library/maven/tags/