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.

84 lines
2.2 KiB

7 years ago
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. - dist/**/*.cfg
  16. only:
  17. - master
  18. - develop
  19. tags:
  20. - docker
  21. test:
  22. stage: test
  23. script:
  24. - echo "Testing happening here"
  25. only:
  26. - master
  27. - develop
  28. tags:
  29. - docker
  30. development:
  31. image: panubo/sshd:latest
  32. stage: deploy
  33. variables:
  34. DEPLOY_USER: "deploy"
  35. DEPLOY_HOST: "sothr.com"
  36. DEPLOY_PORT: "9140"
  37. ENVIRONMENT: "Development"
  38. TARGET_DIRECTORY: "~/download_dir/oc/development"
  39. DOWNLOAD_URL_BASE: "https://sothr.com/download/oc/development/"
  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/{ENVIRONMENT}/'"$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@{FILE_PATH}@'"{}"'@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. script:
  66. - echo "Deployment To Production Starting..."
  67. - eval `ssh-agent -s`
  68. - ssh-add <(echo "$SSH_DEPLOY_KEY")
  69. - pushd ./dist
  70. - find * -type f -exec sed -i -e 's/{ENVIRONMENT}/'"$ENVIRONMENT"'/g' {} \;
  71. - find * -type f -exec sed -i -e 's@{URL_BASE}@'"$DOWNLOAD_URL_BASE"'@g' {} \;
  72. - find * -type f -exec sed -i -e 's@{FILE_PATH}@'"{}"'@g' {} \;
  73. - popd
  74. - rsync -avz --delete-delay -e "ssh -p $DEPLOY_PORT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress dist/* $DEPLOY_USER@$DEPLOY_HOST:$TARGET_DIRECTORY
  75. only:
  76. - master
  77. tags:
  78. - docker
  79. environment: production