explore-services/explore/deploy/prepareDeploy.sh

56 lines
2.3 KiB
Bash
Executable File

#ATTENTION
#DON'T run this script in svn folder - it REMOVES files
#Copy project in another location "deploy-folder"
# go to "deploy-folder/deploy"
#1. uncomment the proper property file
#2. uncomment the rest commands
#3.run the script
#4.Check the Deploy instructions
#Property files:
# uncommect ONE of the following according to the deploy environment!!!
# 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-->
# printf '\nCheck that you have the correct properties file\n';
# printf "\nPress key:";
# read -n1 ans
# pico ../src/assets/env-properties.json;
# printf '\nCheck the properties file version\n';
# echo -n "Press key:";
# read -n1 ans
# pico ../src/app/openaireLibrary/utils/properties/environment-specific.service.ts;
# 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';
# printf '\nUpdate css/ js files version!';
# printf "\nPress key:";
# read -n1 ans
# printf "\nPressed";
# pico ../src/index.html;
# printf '\n\nCheck Robots.txt: \n For test and beta add "Disallow /" and comment all sitemaps, for production remove it!';
# printf "\nPress key:";
# read -n1 ans
# echo -n "Pressed";
# pico ../src/robots.txt;
# rm -rf ../src/assets/common-assets/.svn/;
# rm -rf ../src/app/openaireLibrary/.svn/;
# cd ..; npm run build:ssr; cd deploy;
# 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
#copies of previous deployments exist in "/home/argiro.kokogiannaki/uoa-portal/environment.exlore-YYYY-MM-DD"
#run "npm i"
#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"