Guest User

Untitled

a guest
Aug 7th, 2020
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. .build_node:
  2. extends: .cache
  3. needs:
  4. - install_prod_modules
  5. - install_modules
  6. script:
  7. - yarn run build
  8. artifacts:
  9. paths:
  10. - node_modules_prod/
  11. - build/
  12. expire_in: 30 mins
  13. cache:
  14. policy: pull
  15.  
  16. build-stage:
  17. stage: build_and_test
  18. extends: .build_node
  19. variables:
  20. DEPLOY_ENV: "staging"
  21. except:
  22. - master
  23. - tags
  24.  
  25. build-prod:
  26. stage: build_and_test
  27. extends: .build_node
  28. variables:
  29. DEPLOY_ENV: "production"
  30. only:
  31. - master
  32. - tags
  33.  
  34. check-build:
  35. stage: build_docker
  36. script:
  37. - ls -la
  38.  
  39. .deploy-kubernetes:
  40. stage: deploy
  41. image: dtzar/helm-kubectl:3.2.1
  42. dependencies: []
  43. needs:
  44. - build-docker
  45. variables:
  46. HELM_APP_NS: NS
  47. DOCKER_REGISTRY_SECRET_NAME: gitlab-registry-credentials
  48. IMAGE_TAG: ${CI_COMMIT_REF_SLUG}_${CI_BUILD_REF}
  49. before_script:
  50. - export KUBECONFIG=$K8S_STAGING_CONF
  51. script:
  52. - kubectl create namespace ${HELM_APP_NS} || true
  53. - kubectl -n ${HELM_APP_NS} delete secret ${DOCKER_REGISTRY_SECRET_NAME} || true
  54. - kubectl create secret docker-registry ...
  55. - kubectl get pods -n ${HELM_APP_NS}
  56. - helm upgrade ...
  57.  
  58.  
  59. deploy-branch:
  60. extends: .deploy-kubernetes
  61. environment:
  62. name: staging/${CI_COMMIT_REF_SLUG}
  63. url: https://${CI_COMMIT_REF_SLUG}.dev-example.com
  64. on_stop: remove-branch
  65. auto_stop_in: 1 day
  66. before_script:
  67. - ls -la
  68. variables:
  69. HELM_APP_NAME: ${CI_COMMIT_REF_SLUG}
  70. HELM_VALUES_FILE: charts/NS/values/multistage.yml
  71. when: manual
Add Comment
Please, Sign In to add comment