.gitlab-ci.yml 4.5 KB

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