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.

83 lines
2.2 KiB

7 years ago
7 years ago
7 years ago
  1. image: node:latest
  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/**/*.lua
  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. script:
  40. - echo "Deployment To Development Starting..."
  41. - eval `ssh-agent -s`
  42. - ssh-add <(echo "$SSH_DEPLOY_KEY")
  43. - pushd ./dist
  44. - find * -type f -exec sed -i -e 's/{ENVIRONMENT}/'"$ENVIRONMENT"'/g' {} \;
  45. - find * -type f -exec sed -i -e 's@{URL_BASE}@'"$DOWNLOAD_URL_BASE"'@g' {} \;
  46. - find * -type f -exec sed -i -e 's@{FILE_PATH}@'"{}"'@g' {} \;
  47. - popd
  48. - rsync -avz --delete-delay -e "ssh -p $DEPLOY_PORT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress dist/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY
  49. only:
  50. - develop
  51. tags:
  52. - docker
  53. environment: development
  54. production:
  55. image: panubo/sshd:latest
  56. stage: deploy
  57. variables:
  58. DEPLOY_USER: "deploy"
  59. DEPLOY_HOST: "sothr.com"
  60. DEPLOY_PORT: "9140"
  61. ENVIRONMENT: "Release"
  62. TARGET_DIRECTORY: "~/download_dir/oc/release"
  63. DOWNLOAD_URL_BASE: "https://sothr.com/download/oc/release/"
  64. script:
  65. - echo "Deployment To Production Starting..."
  66. - eval `ssh-agent -s`
  67. - ssh-add <(echo "$SSH_DEPLOY_KEY")
  68. - pushd ./dist
  69. - find * -type f -exec sed -i -e 's/{ENVIRONMENT}/'"$ENVIRONMENT"'/g' {} \;
  70. - find * -type f -exec sed -i -e 's@{URL_BASE}@'"$DOWNLOAD_URL_BASE"'@g' {} \;
  71. - find * -type f -exec sed -i -e 's@{FILE_PATH}@'"{}"'@g' {} \;
  72. - popd
  73. - rsync -avz --delete-delay -e "ssh -p $DEPLOY_PORT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress dist/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY
  74. only:
  75. - master
  76. tags:
  77. - docker
  78. environment: production