Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
|
- #!/bin/bash
- cd /home/sp/go/src/SFM_Loan_RestApi/
- go build
-
- rm -rf /tmp/sfm_loan_rest_api_dist
- mkdir -p /tmp/sfm_loan_rest_api_dist/local-lib
- mkdir -p /tmp/sfm_loan_rest_api_dist/var-sfmapi
- mkdir -p /tmp/sfm_loan_rest_api_dist/var-sfmapi/log
- mkdir -p /tmp/sfm_loan_rest_api_dist/var-sfmapi/tmp
-
- # for /usr/local/lib/sfmapi
- cp apiv1 /tmp/sfm_loan_rest_api_dist/local-lib/
- cp deploy/config.prod.json /tmp/sfm_loan_rest_api_dist/local-lib/config.json
- cp -a html /tmp/sfm_loan_rest_api_dist/local-lib/
- cp -a assets /tmp/sfm_loan_rest_api_dist/local-lib/
-
- # for /var/sfmapi
- cp -a uploads /tmp/sfm_loan_rest_api_dist/var-sfmapi/
- cp -a tmp /tmp/sfm_loan_rest_api_dist/var-sfmapi/
-
-
- # make sure remote service are all available
- ssh root@c5016.biukop.com.au 'mkdir -p /usr/local/lib/sfmapi/ && mkdir -p /var/sfmapi/tmp/dist'
- scp deploy/dependency.sh root@c5016.biukop.com.au:/usr/local/lib/sfmapi/
- scp deploy/local_update.sh root@c5016.biukop.com.au:/usr/local/lib/sfmapi/
- scp deploy/sfmapi.service root@c5016.biukop.com.au:/usr/local/lib/sfmapi/sfmapi.service
- ssh root@c5016.biukop.com.au 'chmod +x /usr/local/lib/sfmapi/dependency.sh && /usr/local/lib/sfmapi/dependency.sh'
-
-
- #dump mysql database
- echo "dump datebase with stored procedures"
- mysqldump -u root -psp --routines syd_credit > /tmp/sfm_loan_rest_api_dist/syd_credit.sql
- gzip -f /tmp/sfm_loan_rest_api_dist/syd_credit.sql
- echo "copy it to remote server"
- scp /tmp/sfm_loan_rest_api_dist/syd_credit.sql.gz root@c5016.biukop.com.au:/var/sfmapi/tmp/dist/
- echo "sync files to remote server"
- rsync -avh --delete /tmp/sfm_loan_rest_api_dist/ root@c5016.biukop.com.au:/var/sfmapi/tmp/dist/
-
-
- # remote update
- ssh root@c5016.biukop.com.au '/usr/local/lib/sfmapi/local_update.sh'
-
- # remove binary file
- rm -f /home/sp/go/src/SFM_Loan_RestApi/apiv1
|