PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gitlab-ci-yml/Maven.gitlab-ci.yml

https://gitlab.com/effigies/gitlab-ce
YAML | 102 lines | 51 code | 13 blank | 38 comment | 0 complexity | 09a988d49b28209d8891717bee8cb530 MD5 | raw file
  1. ---
  2. # Build JAVA applications using Apache Maven (http://maven.apache.org)
  3. # For docker image tags see https://hub.docker.com/_/maven/
  4. #
  5. # For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
  6. #
  7. # This template will build and test your projects as well as create the documentation.
  8. #
  9. # * Caches downloaded dependencies and plugins between invocation.
  10. # * Does only verify merge requests but deploy built artifacts of the
  11. # master branch.
  12. # * Shows how to use multiple jobs in test stage for verifying functionality
  13. # with multiple JDKs.
  14. # * Uses site:stage to collect the documentation for multi-module projects.
  15. # * Publishes the documentation for `master` branch.
  16. variables:
  17. # This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
  18. # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
  19. MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
  20. # As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
  21. # when running from the command line.
  22. # `installAtEnd` and `deployAtEnd`are only effective with recent version of the corresponding plugins.
  23. MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
  24. # Cache downloaded dependencies and plugins between builds.
  25. cache:
  26. paths:
  27. - /root/.m2/repository/
  28. # This will only validate and compile stuff and run e.g. maven-enforcer-plugin.
  29. # Because some enforcer rules might check dependency convergence and class duplications
  30. # we use `test-compile` here instead of `validate`, so the correct classpath is picked up.
  31. .validate: &validate
  32. stage: build
  33. script:
  34. - 'mvn $MAVEN_CLI_OPTS test-compile'
  35. # For merge requests do not `deploy` but only run `verify`.
  36. # See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
  37. .verify: &verify
  38. stage: test
  39. script:
  40. - 'mvn $MAVEN_CLI_OPTS verify site site:stage'
  41. except:
  42. - master
  43. # Validate merge requests using JDK7
  44. validate:jdk7:
  45. <<: *validate
  46. image: maven:3.3.9-jdk-7
  47. # Validate merge requests using JDK8
  48. validate:jdk8:
  49. <<: *validate
  50. image: maven:3.3.9-jdk-8
  51. # Verify merge requests using JDK7
  52. verify:jdk7:
  53. <<: *verify
  54. image: maven:3.3.9-jdk-7
  55. # Verify merge requests using JDK8
  56. verify:jdk8:
  57. <<: *verify
  58. image: maven:3.3.9-jdk-8
  59. # For `master` branch run `mvn deploy` automatically.
  60. # Here you need to decide whether you want to use JDK7 or 8.
  61. # To get this working you need to define a volume while configuring your gitlab-ci-multi-runner.
  62. # Mount your `settings.xml` as `/root/.m2/settings.xml` which holds your secrets.
  63. # See https://maven.apache.org/settings.html
  64. deploy:jdk8:
  65. # Use stage test here, so the pages job may later pickup the created site.
  66. stage: test
  67. script:
  68. - 'mvn $MAVEN_CLI_OPTS deploy site site:stage'
  69. only:
  70. - master
  71. # Archive up the built documentation site.
  72. artifacts:
  73. paths:
  74. - target/staging
  75. image: maven:3.3.9-jdk-8
  76. pages:
  77. image: busybox:latest
  78. stage: deploy
  79. script:
  80. # Because Maven appends the artifactId automatically to the staging path if you did define a parent pom,
  81. # you might need to use `mv target/staging/YOUR_ARTIFACT_ID public` instead.
  82. - mv target/staging public
  83. dependencies:
  84. - deploy:jdk8
  85. artifacts:
  86. paths:
  87. - public
  88. only:
  89. - master