.gitlab-ci.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. - build
  7. - prepare
  8. - test
  9. - clean
  10. - commands
  11. - image-test
  12. - pre-test-source
  13. - deploy
  14. Build:
  15. image: golang:alpine
  16. stage: build
  17. script:
  18. - mkdir -p $GOPATH/src/gitote
  19. - cd $GOPATH/src/gitote
  20. - git clone https://gitote.in/gitote/gitote.git gitote
  21. - cd gitote
  22. - make build
  23. Build Dev:
  24. image: golang:alpine
  25. stage: build
  26. script:
  27. - mkdir -p $GOPATH/src/gitote
  28. - cd $GOPATH/src/gitote
  29. - git clone https://gitote.in/gitote/gitote.git gitote
  30. - cd gitote
  31. - make build-dev
  32. Build Dev Race:
  33. image: golang:latest
  34. before_script:
  35. - apt-get update -qq
  36. - apt-get install -y zip unzip
  37. stage: build
  38. script:
  39. - mkdir -p $GOPATH/src/gitote
  40. - cd $GOPATH/src/gitote
  41. - git clone https://gitote.in/gitote/gitote.git gitote
  42. - cd gitote
  43. - make build-dev-race
  44. Build Prod:
  45. image: golang:latest
  46. before_script:
  47. - apt-get update -qq
  48. - apt-get install -y zip unzip
  49. stage: build
  50. script:
  51. - mkdir -p $GOPATH/src/gitote
  52. - cd $GOPATH/src/gitote
  53. - git clone https://gitote.in/gitote/gitote.git gitote
  54. - cd gitote
  55. - wget https://gitlab.com/gitote/bindata/raw/master/go-bindata
  56. - make bindata
  57. - make build
  58. Compile LESS:
  59. image: golang:alpine
  60. stage: prepare
  61. script:
  62. - mkdir -p $GOPATH/src/gitote
  63. - cd $GOPATH/src/gitote
  64. - git clone https://gitote.in/gitote/gitote.git gitote
  65. - cd gitote
  66. - make less
  67. Bindata:
  68. image: golang:alpine
  69. stage: prepare
  70. script:
  71. - mkdir -p $GOPATH/src/gitote
  72. - cd $GOPATH/src/gitote
  73. - git clone https://gitote.in/gitote/gitote.git gitote
  74. - cd gitote
  75. - wget https://gitlab.com/gitote/bindata/raw/master/go-bindata
  76. - make bindata
  77. Test:
  78. image: golang:latest
  79. before_script:
  80. - apt-get update -qq
  81. - apt-get install -y zip unzip
  82. stage: test
  83. script:
  84. - mkdir -p $GOPATH/src/gitote
  85. - cd $GOPATH/src/gitote
  86. - git clone https://gitote.in/gitote/gitote.git gitote
  87. - cd gitote
  88. - go test -v -cover -race ./...
  89. Go LOC:
  90. image: golang:alpine
  91. stage: test
  92. script:
  93. - mkdir -p $GOPATH/src/gitote
  94. - cd $GOPATH/src/gitote
  95. - git clone https://gitote.in/gitote/gitote.git gitote
  96. - cd gitote
  97. - go get -u github.com/hhatto/gocloc/cmd/gocloc
  98. - gocloc .
  99. Clean:
  100. image: golang:alpine
  101. stage: clean
  102. script:
  103. - mkdir -p $GOPATH/src/gitote
  104. - cd $GOPATH/src/gitote
  105. - git clone https://gitote.in/gitote/gitote.git gitote
  106. - cd gitote
  107. - make clean
  108. Admin:
  109. image: golang:alpine
  110. stage: commands
  111. script:
  112. - mkdir -p $GOPATH/src/gitote
  113. - cd $GOPATH/src/gitote
  114. - git clone https://gitote.in/gitote/gitote.git gitote
  115. - cd gitote
  116. - go build
  117. - ./gitote admin
  118. Hook:
  119. image: golang:alpine
  120. stage: commands
  121. script:
  122. - mkdir -p $GOPATH/src/gitote
  123. - cd $GOPATH/src/gitote
  124. - git clone https://gitote.in/gitote/gitote.git gitote
  125. - cd gitote
  126. - go build
  127. - ./gitote hook
  128. Import:
  129. image: golang:alpine
  130. stage: commands
  131. script:
  132. - mkdir -p $GOPATH/src/gitote
  133. - cd $GOPATH/src/gitote
  134. - git clone https://gitote.in/gitote/gitote.git gitote
  135. - cd gitote
  136. - go build
  137. - ./gitote import
  138. Cert:
  139. image: golang:alpine
  140. stage: commands
  141. script:
  142. - mkdir -p $GOPATH/src/gitote
  143. - cd $GOPATH/src/gitote
  144. - git clone https://gitote.in/gitote/gitote.git gitote
  145. - cd gitote
  146. - go build
  147. - ./gitote cert --help
  148. Serv:
  149. image: golang:alpine
  150. stage: commands
  151. script:
  152. - mkdir -p $GOPATH/src/gitote
  153. - cd $GOPATH/src/gitote
  154. - git clone https://gitote.in/gitote/gitote.git gitote
  155. - cd gitote
  156. - go build
  157. - ./gitote serv --help
  158. Running:
  159. image: golang:alpine
  160. stage: pre-test-source
  161. script:
  162. - mkdir -p $GOPATH/src/gitote
  163. - cd $GOPATH/src/gitote
  164. - git clone https://gitote.in/gitote/gitote.git gitote
  165. - cd gitote
  166. - go build
  167. - ./gitote web & sleep 20 ; kill $! || echo $?
  168. DockerHub:
  169. image: docker:latest
  170. stage: deploy
  171. services:
  172. - docker:dind
  173. script:
  174. - mkdir -p $GOPATH/src/gitote
  175. - cd $GOPATH/src/gitote
  176. - git clone https://gitote.in/gitote/gitote.git gitote
  177. - cd gitote
  178. - docker login -u yoginth -p $CI_REGISTRY_PASSWORD docker.io
  179. - docker build -t gitote/gitote .
  180. - docker push gitote/gitote:latest
  181. only:
  182. - master