.gitlab-ci.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. variables:
  2. # This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
  3. # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
  4. MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
  5. # As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
  6. # when running from the command line.
  7. # `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
  8. MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
  9. # Cache downloaded dependencies and plugins between builds.
  10. # To keep cache across branches add 'key: "$CI_JOB_NAME"'
  11. cache:
  12. paths:
  13. - .m2/repository
  14. build:
  15. image: maven:3.3.9-jdk-8
  16. stage: build
  17. tags:
  18. - dev
  19. script:
  20. - mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.1.0 -Dpackaging=jar -Dfile=$CI_PROJECT_DIR/ojdbc6.jar
  21. - mvn install:install-file -DgroupId=org.javia -DartifactId=arity -Dversion=2.1.7 -Dpackaging=jar -Dfile=$CI_PROJECT_DIR/arity-2.1.7.jar
  22. - mvn install:install-file -DgroupId=com.susumitec -DartifactId=smxcrypto -Dversion=1.0.0 -Dpackaging=jar -Dfile=$CI_PROJECT_DIR/smxcrypto-1.0.0.jar
  23. - mvn $MAVEN_CLI_OPTS -DskipTests package
  24. only:
  25. - master
  26. # Archive up the built documentation site.
  27. artifacts:
  28. paths:
  29. - target/jnjp-0.1.1.jar
  30. deploy:
  31. image: docker:latest
  32. stage: deploy
  33. tags:
  34. - dev
  35. dependencies:
  36. - build
  37. before_script:
  38. - docker login -u "cnooc" -p "cnooc2018"
  39. script:
  40. - docker build --pull -t "cnooc/jnjp_server" .
  41. - docker push "cnooc/jnjp_server"