2019-05-30 12:06:30 +02:00
#ATTENTION
2019-08-02 16:49:17 +02:00
#DON'T run this script in svn folder - it REMOVES files
#Copy project in another location "deploy-folder"
# go to "deploy-folder/deploy"
2019-05-30 12:06:30 +02:00
2019-08-02 16:49:17 +02:00
#1. uncomment the proper property file
#2. uncomment the rest commands
#3.run the script
#4.Check the Deploy instructions
2019-05-30 12:06:30 +02:00
2019-08-02 16:49:17 +02:00
#Property files:
# uncommect ONE of the following according to the deploy environment!!!
2019-05-30 12:06:30 +02:00
# cp production-properties.json ../src/assets/env-properties.json;
# cp test-properties.json ../src/assets/env-properties.json;
# cp beta-properties.json ../src/assets/env-properties.json;
## uncommect from here-->
2019-08-02 16:49:17 +02:00
# printf '\nCheck that you have the correct properties file\n';
2019-08-28 11:59:31 +02:00
# printf "\nPress key:";
2019-05-30 12:06:30 +02:00
# read -n1 ans
# pico ../src/assets/env-properties.json;
2019-09-10 13:48:21 +02:00
# printf '\nCheck the properties file version\n';
# echo -n "Press key:";
# read -n1 ans
# pico ../src/app/openaireLibrary/utils/properties/environment-specific.service.ts;
2019-08-02 16:49:17 +02:00
# printf '\nFor Production keep meta for bots';
# printf '\n\nCheck index.html:\n For test keep meta for noindex, for production remove noindex and keep meta for Search engines verification';
2019-09-10 13:48:21 +02:00
# printf '\nUpdate css/ js files version!';
2019-08-02 16:49:17 +02:00
# printf "\nPress key:";
2019-05-30 12:06:30 +02:00
# read -n1 ans
2019-08-02 16:49:17 +02:00
# printf "\nPressed";
2019-05-30 12:06:30 +02:00
# pico ../src/index.html;
2019-08-02 16:49:17 +02:00
# printf '\n\nCheck Robots.txt: \n For test and beta add "Disallow /" and comment all sitemaps, for production remove it!';
# printf "\nPress key:";
2019-05-30 12:06:30 +02:00
# read -n1 ans
# echo -n "Pressed";
# pico ../src/robots.txt;
# rm -rf ../src/assets/common-assets/.svn/;
# rm -rf ../src/app/openaireLibrary/.svn/;
2019-06-03 15:21:49 +02:00
# cd ..; npm run build:ssr; cd deploy;
2019-05-30 12:06:30 +02:00
# rm -rf ../src ../node_modules ../.idea/ ../installOpenaireLib.sh;
# cd ..; rm -rf deploy;
# echo 'Now copy to the server!'
##<-- to here
#Deploy instructions!
#copy "deploy-folder" in beta.explore.openaire.eu, test.openaire.eu or explore.openaire.eu depending which in environment want to deploy and properties selected
2019-08-02 16:49:17 +02:00
#copies of previous deployments exist in "/home/argiro.kokogiannaki/uoa-portal/environment.exlore-YYYY-MM-DD"
2019-05-30 12:06:30 +02:00
#run "npm i"
2019-08-02 16:49:17 +02:00
#become nodejs user be able to copy the files: "sudo su nodejs -s /bin/bash"
#check what is running "pm2 list"
#portal files exist in "/srv/www/portal"
#copy deployment files to the portal folder cp -r /home/argiro.kokogiannaki/uoa-portal/environment.exlore-YYYY-MM-DD/* /srv/www/portal"
#restart portal to get the changes "pm2 restart openaire"
#for test "pm2 restart test-explore"