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.

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