Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ##############################################
- # MAIN BUILD SCRIPT
- # Prepare build artifacts here
- # This is to be run directly on build server
- set -xe;
- ##############################################
- APP="core-api";
- APP_PORT="8080";
- AWS_CODE_DEPLOY_APP_NAME="CI_CoreAPI_CodeDeploy";
- AWS_CODE_DEPLOY_GROUP_NAME="CI_CoreAPI_DeployGroup";
- TO_ENV="ci"
- #TEMPORARILY MOVE FILES WHICH DON'T NEED TO BE PART OF THE BUILD
- rm -rf /tmp/$APP;
- mkdir -p /tmp/$APP;
- mv -vf apidoc.json /tmp/$APP || true;
- mv -vf devstart.sh /tmp/$APP || true;
- mv -vf devwatch.js /tmp/$APP || true;
- mv -vf README.md /tmp/$APP || true;
- mv -vf test-report.xml /tmp/$APP || true;
- mv -vf yarn.lock /tmp/$APP || true;
- mv -vf .git /tmp/$APP || true;
- mv -vf .gitignore /tmp/$APP || true;
- mv -vf .eslintrc /tmp/$APP || true;
- mv -vf .eslintignore /tmp/$APP || true;
- mv -vf .foreverignore /tmp/$APP || true;
- mv -vf build /tmp/$APP || true;
- mv -vf test /tmp/$APP || true;
- #RUN DEPLOY SCRIPT
- STARTTIME=$(date +%s);
- /opt/code-deploy/service/build.sh $APP $APP_PORT $AWS_CODE_DEPLOY_APP_NAME $AWS_CODE_DEPLOY_GROUP_NAME $TO_ENV;
- ENDTIME=$(date +%s);
- echo "Built and deployed to CI in $(($ENDTIME - $STARTTIME)) seconds.";
- #PUT ALL FILES BACK INTO BUILD DIRECTORY
- mv -vf /tmp/$APP/* .;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement