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.

80 lines
1.9 KiB

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