Project

General

Profile

Update TEST server - production@idoc-medoc-test » History » Version 2

Version 1 (Guanji Wang, 11/08/2017 17:47) → Version 2/3 (Guanji Wang, 21/09/2017 10:29)

h1. Update TEST server - production@idoc-medoc-test

>h2. A. Prepare the test-server branch in git:

>1. In branch 'master', git add, commit and push all update to gitlab IAS.

>2. Test pysitools and idoc-medoc-test to see:
>* If the project && datasets are well detected.
>* If the download function works.
>* If all tests pass and the result is Ok, then go to step 3.

>3. Git checkout 'test-server' branch, git cherry-pick the commit ID which are used in test server.

>4. In case if there are some conflicts or conflict headers added in XML files, for easier and cleaner update, we can delete the data folder in branch test-server, then ' git checkout master -- data' -data' to recover the proper data from 'master' branch.

>5. Attention, in master branch, data source is sdo3 but not sdo, so we need execute my script - transfer_local_test.cmd (The link : https://git.ias.u-psud.fr/gwang/idoc-medoc-solar-portal/blob/test-server/transfer_local_test.cmd)

><pre><code class="javascript">
#!/bin/bash
echo "This is a shell to replace the host name in datasets or preference or sdodownload form url etc.."

sdo3_cgi='sdo3.ias.u-psud.fr/VSO/DRMS/cgi-bin/ias_export_hmi.cgi'
sdo_cgi='sdo.ias.u-psud.fr/SDO/ias_export_hmi.cgi'

sdoformlocal='localhost:8184/sitools/datastorage/user/idoc_medoc/sdodownloadform.html'
sdoformtest='idoc-medoc-test.ias.u-psud.fr/sitools/datastorage/user/idoc_medoc/sdodownloadform.html'

sdo3datasource='jdbc:postgresql://sdo3.ias.u-psud.fr:5436'
sdodatasource='jdbc:postgresql://sdo.ias.u-psud.fr:5436'

sdo3metasource='jdbc:postgresql://sdo3:5432'
sdometasource='jdbc:postgresql://sdo:5432'

echo "Change cgi sdo3 to sdo"

find ./ -type f ! -name 'transfer_server_test.cmd' -exec sed -i -e "s|$sdo3_cgi|$sdo_cgi|g" {} \;
echo "Done modifier the path"
echo "Stupid changes begin"

find ./ -type f ! -name 'transfer_server_test.cmd' -exec sed -i -e "s|$sdoformlocal|$sdoformtest|g" {} \;
echo "Done modifier the sdo form host domain"

find ./ -type f ! -name 'transfer_server_test.cmd' -exec sed -i -e "s|$sdo3datasource|$sdodatasource|g" {} \;
echo "Done modifier the sdo data source"

find ./ -type f ! -name 'transfer_server_test.cmd' -exec sed -i -e "s|$sdo3metasource|$sdometasource|g" {} \;
echo "Done modifier meta data source"

echo "Stupid change finish"
</code></pre>

>6. Every time we restart sitools, the lastupdatedate element in all XML files will be updated, so don't forget to re-commit all the new changes.

>h2. B. In the test server:

>1. Check if the sitools will be restarted automatically in case of the cut of electricity.

><pre><code class="python">
cat /etc/rc.local
</code></pre>

>!Selection_387.jpg!

>2. Stop the sitools project and git fetch the source: git fetch {repository} {branch}.

>3. Git pull: If there are conflicts in XML, try to commit the conflicts and if it works, go to step5, if it doesn't work, go to step 4.

>4. Re-distribute sitools project by executing cmd in following production@idoc-medoc-test : /home/production/scripts/Dev_To_Test_git_clone.cmd.

><pre><code class="javascript">
#!/bin/bash

NOW=$(date +"%Y-%m-%d")

SitoolsDirTest=/usr/local/Sitools2_solar

$SitoolsDirTest/workspace/fr.cnes.sitools.core/sitools stop
wait ${!}

#echo $SitoolsDirTest $SitoolsDirTest"_"$NOW
rm -Rf $SitoolsDirTest"_"$NOW
mv $SitoolsDirTest $SitoolsDirTest"_"$NOW
#mkdir /usr/local/Sitools2_solar

git clone https://gwang@git.ias.u-psud.fr/gwang/idoc-medoc-solar-portal.git -b test-server /usr/local/Sitools2_solar
#echo $USER@$HOSTNAME:$SitoolsDir/*

mkdir $SitoolsDirTest/data/resourses_logs_solar

$SitoolsDirTest/workspace/fr.cnes.sitools.core/sitools start

echo "Please erase old Sitools2_solar dir on disk "
Dev_To_Test_git_clone.cmd (END)

</code></pre>

>5. Restart the sitools project.

>6. Track the log, do simple test in idoc-medoc-test and have fun.

>h2. C. ANNEXE:

>1. The commits in the test-server branch - https://git.ias.u-psud.fr/gwang/idoc-medoc-solar-portal/commits/test-server

>2. The whole project source code for test branch - https://git.ias.u-psud.fr/gwang/idoc-medoc-solar-portal/tree/test-server