.gitlab-ci.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. image: golang:alpine
  2. before_script:
  3. - apk update
  4. - apk --no-cache --no-progress add --virtual build-deps build-base git
  5. stages:
  6. - test
  7. - build
  8. - execute
  9. - deploy
  10. Compile LESS:
  11. image: golang:alpine
  12. stage: test
  13. script:
  14. - mkdir -p $GOPATH/src/gitote
  15. - cd $GOPATH/src/gitote
  16. - git clone https://gitlab.com/gitote/gitote.git gitote
  17. - cd gitote
  18. - make less
  19. Bindata:
  20. image: golang:alpine
  21. stage: test
  22. script:
  23. - mkdir -p $GOPATH/src/gitote
  24. - cd $GOPATH/src/gitote
  25. - git clone https://gitlab.com/gitote/gitote.git gitote
  26. - cd gitote
  27. - wget https://gitlab.com/gitote/bindata/raw/master/go-bindata
  28. - make bindata
  29. Clean:
  30. image: golang:alpine
  31. stage: test
  32. script:
  33. - mkdir -p $GOPATH/src/gitote
  34. - cd $GOPATH/src/gitote
  35. - git clone https://gitlab.com/gitote/gitote.git gitote
  36. - cd gitote
  37. - make clean
  38. Build:
  39. image: golang:alpine
  40. stage: build
  41. script:
  42. - mkdir -p $GOPATH/src/gitote
  43. - cd $GOPATH/src/gitote
  44. - git clone https://gitlab.com/gitote/gitote.git gitote
  45. - cd gitote
  46. - make build
  47. Build Prod:
  48. image: golang:latest
  49. before_script:
  50. - apt-get update -qq
  51. - apt-get install -y zip unzip
  52. stage: build
  53. script:
  54. - mkdir -p $GOPATH/src/gitote
  55. - cd $GOPATH/src/gitote
  56. - git clone https://gitlab.com/gitote/gitote.git gitote
  57. - cd gitote
  58. - wget https://gitlab.com/gitote/bindata/raw/master/go-bindata
  59. - make bindata
  60. - make build
  61. Admin:
  62. image: golang:alpine
  63. stage: execute
  64. script:
  65. - mkdir -p $GOPATH/src/gitote
  66. - cd $GOPATH/src/gitote
  67. - git clone https://gitlab.com/gitote/gitote.git gitote
  68. - cd gitote
  69. - go build
  70. - ./gitote admin
  71. Hook:
  72. image: golang:alpine
  73. stage: execute
  74. script:
  75. - mkdir -p $GOPATH/src/gitote
  76. - cd $GOPATH/src/gitote
  77. - git clone https://gitlab.com/gitote/gitote.git gitote
  78. - cd gitote
  79. - go build
  80. - ./gitote hook
  81. Import:
  82. image: golang:alpine
  83. stage: execute
  84. script:
  85. - mkdir -p $GOPATH/src/gitote
  86. - cd $GOPATH/src/gitote
  87. - git clone https://gitlab.com/gitote/gitote.git gitote
  88. - cd gitote
  89. - go build
  90. - ./gitote import
  91. Cert:
  92. image: golang:alpine
  93. stage: execute
  94. script:
  95. - mkdir -p $GOPATH/src/gitote
  96. - cd $GOPATH/src/gitote
  97. - git clone https://gitlab.com/gitote/gitote.git gitote
  98. - cd gitote
  99. - go build
  100. - ./gitote cert --help
  101. Serv:
  102. image: golang:alpine
  103. stage: execute
  104. script:
  105. - mkdir -p $GOPATH/src/gitote
  106. - cd $GOPATH/src/gitote
  107. - git clone https://gitlab.com/gitote/gitote.git gitote
  108. - cd gitote
  109. - go build
  110. - ./gitote serv --help
  111. Web:
  112. image: golang:alpine
  113. stage: execute
  114. script:
  115. - mkdir -p $GOPATH/src/gitote
  116. - cd $GOPATH/src/gitote
  117. - git clone https://gitlab.com/gitote/gitote.git gitote
  118. - cd gitote
  119. - go build
  120. - ./gitote web & sleep 20 ; kill $! || echo $?
  121. DockerHub:
  122. image: docker:latest
  123. stage: deploy
  124. services:
  125. - docker:dind
  126. script:
  127. - mkdir -p $GOPATH/src/gitote
  128. - cd $GOPATH/src/gitote
  129. - git clone https://gitlab.com/gitote/gitote.git gitote
  130. - cd gitote
  131. - docker login -u yoginth -p $CI_REGISTRY_PASSWORD docker.io
  132. - docker build -t gitote/gitote .
  133. - docker push gitote/gitote:latest
  134. only:
  135. - master
  136. Registry:
  137. image: docker:latest
  138. stage: deploy
  139. services:
  140. - docker:dind
  141. script:
  142. - mkdir -p $GOPATH/src/gitote
  143. - cd $GOPATH/src/gitote
  144. - git clone https://gitlab.com/gitote/gitote.git gitote
  145. - cd gitote
  146. - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
  147. - docker build -t registry.gitlab.com/gitote/gitote .
  148. - docker push registry.gitlab.com/gitote/gitote:latest
  149. only:
  150. - master