.gitlab-ci.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # This file is a template, and might need editing before it works on your project.
  2. # image: golang:latest
  3. # variables:
  4. # Please edit to your GitLab project
  5. # REPO_NAME: gitlab.com/namespace/project
  6. # The problem is that to be able to use go get, one needs to put
  7. # the repository in the $GOPATH. So for example if your gitlab domain
  8. # is gitlab.com, and that your repository is namespace/project, and
  9. # the default GOPATH being /go, then you'd need to have your
  10. # repository in /go/src/gitlab.com/namespace/project
  11. # Thus, making a symbolic link corrects this.
  12. # before_script:
  13. # - mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
  14. # - ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
  15. # - cd $GOPATH/src/$REPO_NAME
  16. stages:
  17. - build
  18. - push
  19. - deploy
  20. build:
  21. stage: build
  22. script:
  23. - make create-version
  24. - make linux-build
  25. - make docker-build
  26. push:
  27. stage: push
  28. script:
  29. - make docker-push
  30. deploy:
  31. stage: deploy
  32. script:
  33. - cd ~/cluster-config && git pull
  34. - kubectl delete -f ~/cluster-config/ob-server/deployment.yaml
  35. - kubectl apply -f ~/cluster-config/ob-server/deployment.yaml
  36. - kubectl delete --ignore-not-found=true -f ~/cluster-config/ob-server/deployment_consumer.yaml
  37. - kubectl apply -f ~/cluster-config/ob-server/deployment_consumer.yaml