build.gradle 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. buildscript {
  2. repositories {
  3. maven { url 'https://maven.aliyun.com/repository/central' }
  4. }
  5. dependencies {
  6. classpath('se.transmode.gradle:gradle-docker:1.2')
  7. }
  8. }
  9. apply plugin: 'docker'
  10. apply plugin: 'application'
  11. group 'cn.tonyandmoney.tuon'
  12. version '0.1.0'
  13. dependencies {
  14. compile project(':tuon-core')
  15. compile project(':tuon-qywx')
  16. compile project(':tuon-gateway')
  17. compile('org.springframework.cloud:spring-cloud-starter-config')
  18. implementation('org.springframework.boot:spring-boot-starter-webflux')
  19. }
  20. docker{
  21. baseImage 'openjdk:8-jre-alpine'
  22. maintainer 'tina 976056042@qq.com'
  23. registry 'docker.tonyandmoney.cn'
  24. }
  25. task dockerBuilder(type: Docker) {
  26. registry='docker.tonyandmoney.cn'
  27. applicationName = 'tuon-fw'
  28. tagVersion = jar.version
  29. addFile("./${jar.baseName}-${jar.version}.jar","app.jar")
  30. entryPoint(["java","-XX:+UnlockExperimentalVMOptions","-XX:+UseCGroupMemoryLimitForHeap","-Djava.security.egd=file:/dev/./urandom","-Duser.timezone=GMT+08","-jar",'app.jar'])
  31. exposePort(11000)
  32. doFirst {
  33. copy {
  34. from jar
  35. into stageDir
  36. }
  37. }
  38. push = true
  39. }
  40. dockerBuilder.dependsOn(bootJar)
  41. task innerDockerBuilder(type: Docker){
  42. registry='registry.tuonq.cn:5000'
  43. applicationName = 'tuon-fw'
  44. tagVersion = jar.version
  45. addFile("./${jar.baseName}-${jar.version}.jar","app.jar")
  46. entryPoint(["java","-XX:+UnlockExperimentalVMOptions","-XX:+UseCGroupMemoryLimitForHeap","-Djava.security.egd=file:/dev/./urandom","-Duser.timezone=GMT+08","-jar",'app.jar'])
  47. exposePort(11000)
  48. doFirst {
  49. copy {
  50. from jar
  51. into stageDir
  52. }
  53. }
  54. push = true
  55. }
  56. innerDockerBuilder.dependsOn(bootJar)
  57. bootJar { enabled = true }
  58. jar { enabled = false }