Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ##############################################
  4. # MAIN BUILD SCRIPT
  5. # Prepare build artifacts here
  6. # This is to be run directly on build server
  7.  
  8. set -xe;
  9. ##############################################
  10.  
  11.  
  12. APP="core-api";
  13. APP_PORT="8080";
  14. AWS_CODE_DEPLOY_APP_NAME="CI_CoreAPI_CodeDeploy";
  15. AWS_CODE_DEPLOY_GROUP_NAME="CI_CoreAPI_DeployGroup";
  16. TO_ENV="ci"
  17.  
  18. #TEMPORARILY MOVE FILES WHICH DON'T NEED TO BE PART OF THE BUILD
  19. rm -rf /tmp/$APP;
  20. mkdir -p /tmp/$APP;
  21.  
  22. mv -vf apidoc.json /tmp/$APP || true;
  23. mv -vf devstart.sh /tmp/$APP || true;
  24. mv -vf devwatch.js /tmp/$APP || true;
  25. mv -vf README.md /tmp/$APP || true;
  26. mv -vf test-report.xml /tmp/$APP || true;
  27. mv -vf yarn.lock /tmp/$APP || true;
  28. mv -vf .git /tmp/$APP || true;
  29. mv -vf .gitignore /tmp/$APP || true;
  30. mv -vf .eslintrc /tmp/$APP || true;
  31. mv -vf .eslintignore /tmp/$APP || true;
  32. mv -vf .foreverignore /tmp/$APP || true;
  33. mv -vf build /tmp/$APP || true;
  34. mv -vf test /tmp/$APP || true;
  35.  
  36.  
  37. #RUN DEPLOY SCRIPT
  38. STARTTIME=$(date +%s);
  39. /opt/code-deploy/service/build.sh $APP $APP_PORT $AWS_CODE_DEPLOY_APP_NAME $AWS_CODE_DEPLOY_GROUP_NAME $TO_ENV;
  40. ENDTIME=$(date +%s);
  41. echo "Built and deployed to CI in $(($ENDTIME - $STARTTIME)) seconds.";
  42.  
  43. #PUT ALL FILES BACK INTO BUILD DIRECTORY
  44. mv -vf /tmp/$APP/* .;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement