You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.3 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. image: sothr.com/lua_builder:stable
  2. stages:
  3. - build
  4. - test
  5. - deploy
  6. compile:
  7. stage: build
  8. script:
  9. - npm install
  10. - npm run grunt
  11. artifacts:
  12. expire_in: 6 hours
  13. paths:
  14. - dist/
  15. only:
  16. - master
  17. - develop
  18. tags:
  19. - docker
  20. test:
  21. stage: test
  22. script:
  23. - echo "Testing happening here"
  24. only:
  25. - master
  26. - develop
  27. tags:
  28. - docker
  29. development:
  30. image: panubo/sshd:latest
  31. stage: deploy
  32. variables:
  33. DEPLOY_USER: "deploy"
  34. DEPLOY_HOST: "sothr.com"
  35. DEPLOY_PORT: "9140"
  36. ENVIRONMENT: "Development"
  37. TARGET_DIRECTORY: "~/download_dir/oc/development"
  38. DOWNLOAD_URL_BASE: "https://sothr.com/download/oc/development"
  39. MINIFIED_SOURCE: "false"
  40. script:
  41. - echo "Deployment To Development Starting..."
  42. - eval `ssh-agent -s`
  43. - ssh-add <(echo "$SSH_DEPLOY_KEY")
  44. - pushd ./dist
  45. - find * -type f -exec sed -i -e 's@{ENV}@'"$ENVIRONMENT"'@g' {} \;
  46. - find * -type f -exec sed -i -e 's@{URL_BASE}@'"$DOWNLOAD_URL_BASE"'@g' {} \;
  47. - find * -type f -exec sed -i -e 's@{MINIFIED}@'"$MINIFIED_SOURCE"'@g' {} \;
  48. - popd
  49. - rsync -avz --delete-delay -e "ssh -p $DEPLOY_PORT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress dist/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY
  50. only:
  51. - develop
  52. tags:
  53. - docker
  54. environment: development
  55. production:
  56. image: panubo/sshd:latest
  57. stage: deploy
  58. variables:
  59. DEPLOY_USER: "deploy"
  60. DEPLOY_HOST: "sothr.com"
  61. DEPLOY_PORT: "9140"
  62. ENVIRONMENT: "Release"
  63. TARGET_DIRECTORY: "~/download_dir/oc/release"
  64. DOWNLOAD_URL_BASE: "https://sothr.com/download/oc/release"
  65. MINIFIED_SOURCE: "true"
  66. script:
  67. - echo "Deployment To Production Starting..."
  68. - eval `ssh-agent -s`
  69. - ssh-add <(echo "$SSH_DEPLOY_KEY")
  70. - pushd ./dist
  71. - find * -type f -exec sed -i -e 's@{ENV}@'"$ENVIRONMENT"'@g' {} \;
  72. - find * -type f -exec sed -i -e 's@{URL_BASE}@'"$DOWNLOAD_URL_BASE"'@g' {} \;
  73. - find * -type f -exec sed -i -e 's@{MINIFIED}@'"$MINIFIED_SOURCE"'@g' {} \;
  74. - popd
  75. - rsync -avz --delete-delay -e "ssh -p $DEPLOY_PORT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress dist/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY
  76. only:
  77. - master
  78. tags:
  79. - docker
  80. environment: production