Skip to content
Snippets Groups Projects
Commit 92ad43c6 authored by Armand Bahi's avatar Armand Bahi
Browse files

Add utils for windows install

parent 3c5afe6c
No related branches found
No related tags found
No related merge requests found
robocopy "githooks" "../.git/hooks" /E /NFL /NDL /NJH /NJS /nc /ns /np
#!/bin/bash #!/bin/bash
# #
# Récupère l'ensemble des dépendances depuis conf/_install/dependency.xml # Récupère l'ensemble des dépendances depuis conf/_install/dependency.xml
# Nécessite xmllint : sudo apt install libxml2-utils
# #
# #
# #
# #
if [ "../conf/_install/dependency.xml" ]; then if [ "../conf/_install/dependency.xml" ]; then
let depsCount=$(xmllint --xpath 'count(//dependenciesCollection/dependency/name)' ../conf/_install/dependency.xml)
declare -A aDeps declare -A aDeps
vitisVersion=master vitisVersion=master
depsCount=0
dependencies=($(cat "../conf/_install/dependency.xml" | tr -d '\040\011\012\015' | grep -oP '<dependency>([\s\S]*?)<\/dependency>'))
for (( i=1; i <= $depsCount; i++ )); do for i in ${!dependencies[*]}; do
sName="$(xmllint --xpath 'string(//dependenciesCollection/dependency['$i']/name)' ../conf/_install/dependency.xml)" sName=$(grep -oP '(?<=name>)[^<]+' <<< ${dependencies[$i]})
sVersion="$(xmllint --xpath 'string(//dependenciesCollection/dependency['$i']/version)' ../conf/_install/dependency.xml)" sVersion=$(grep -oP '(?<=version>)[^<]+' <<< ${dependencies[$i]})
sNature="$(xmllint --xpath 'string(//dependenciesCollection/dependency['$i']/nature)' ../conf/_install/dependency.xml)" sNature=$(grep -oP '(?<=nature>)[^<]+' <<< ${dependencies[$i]})
if [ $sName == "vitis" ]; then if [ $sName == "vitis" ]; then
vitisVersion=$sVersion vitisVersion=$sVersion
...@@ -27,22 +26,22 @@ if [ "../conf/_install/dependency.xml" ]; then ...@@ -27,22 +26,22 @@ if [ "../conf/_install/dependency.xml" ]; then
aDeps[$i, name]=$sName aDeps[$i, name]=$sName
aDeps[$i, version]=$sVersion aDeps[$i, version]=$sVersion
aDeps[$i, nature]=$sNature aDeps[$i, nature]=$sNature
let depsCount++
fi fi
done done
echo "[INFO] dependencies:" echo "[INFO] dependencies:"
echo "vitis : $vitisVersion" echo "vitis : $vitisVersion"
for (( i=1; i <= $depsCount; i++ )); do for i in ${!dependencies[*]}; do
echo "(${aDeps[$i, nature]}) ${aDeps[$i, name]} : ${aDeps[$i, version]}"
echo "name: ${aDeps[$i, name]}"
echo "version: ${aDeps[$i, version]}"
done done
echo "depsCount : ${depsCount}"
export vitisVersion export vitisVersion
export depsCount export depsCount
export aDeps export aDeps
else else
echo "[ERROR] ../conf/_install/dependency.xml not found" echo "[ERROR] ../conf/_install/dependency.xml not found"
fi fi
@echo off
title Install Vitis App
setlocal EnableDelayedExpansion
cd ..
set /p existing_path="Existing app path: "
REM Client Dir
echo Create client directory
if exist "client" (
rmdir /S /Q "client"
)
echo copy client
robocopy "src/vitis/client" "client" /E /NFL /NDL /NJH /NJS /nc /ns /np
echo copy client/conf
robocopy "conf" "client/conf" /E /NFL /NDL /NJH /NJS /nc /ns /np
echo copy client/conf/closure
robocopy "src/closure/conf" "client/conf/closure" /E /NFL /NDL /NJH /NJS /nc /ns /np
echo Copy client modules
for /d %%g in ("src/module_*") do (
set x=%%g
echo !x:~7!
if exist "src/%%g/module" (
echo copy client/modules/!x:~7!
robocopy "src/%%g/module" "client/modules/!x:~7!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
)
REM VAS dir
echo Create vas directory
echo Create client directory
if exist "vas" (
rmdir /S /Q "vas"
)
echo copy vas
robocopy "src/vitis/vas" "vas" /E /NFL /NDL /NJH /NJS /nc /ns /np
echo Copy vas web_services
for /d %%g in ("src/module_*") do (
set x=%%g
echo !x:~7!
if exist "src/%%g/web_service/conf" (
echo copy vas/rest/conf/!x:~7!
robocopy "src/%%g/web_service/conf" "vas/rest/conf/!x:~7!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "src/%%g/web_service/sql" (
echo copy vas/sql/!x:~7!
robocopy "src/%%g/web_service/sql" "vas/sql/!x:~7!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "src/%%g/web_service/ws" (
echo copy vas/rest/ws/!x:~7!
robocopy "src/%%g/web_service/ws" "vas/rest/ws/!x:~7!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "src/%%g/web_service/class" (
echo copy vas/rest/class
robocopy "src/%%g/web_service/class" "vas/rest/class" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "src/%%g/web_service/ws_data" (
echo copy vas/ws_data
robocopy "src/%%g/web_service/ws_data" "vas/ws_data" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "src/%%g/web_service/public" (
echo copy vas/public
robocopy "src/%%g/web_service/public" "vas/public" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "src/%%g/web_service/upload" (
echo copy vas/upload
robocopy "src/%%g/web_service/upload" "vas/upload" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
)
REM Copy from existing path
if exist %existing_path% (
echo copy properties from %existing_path%
for %%G in (vas\server,vas\rest\conf,vas\log,vas\public,vas\shared,vas\tmp,vas\upload,vas\ws_data) do (
echo %%G
if exist %existing_path%\%%G (
echo copy %%G
robocopy "%existing_path%\%%G" "%%G" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
)
if exist %existing_path%\client\conf\properties.json (
echo copy properties.json
robocopy "%existing_path%\client\conf" "client\conf" "properties.json" /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist %existing_path%\vas\rest\.htaccess (
echo copy .htaccess
robocopy "%existing_path%\vas\rest" "vas\rest" ".htaccess" /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "%existing_path%\vas\rest\conf" (
echo copy vas\rest\conf
robocopy "%existing_path%\vas\rest\conf" "vas\rest\conf" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
)
...@@ -17,17 +17,7 @@ cd .. ...@@ -17,17 +17,7 @@ cd ..
# Vitis # Vitis
echo "---- Pull vitis ----" echo "---- Pull vitis ----"
git subtree pull --prefix src/vitis --squash -m "pull subtree" "git@gitlab.veremes.net:Development/vitis_apps/sources/vitis.git" master git subtree pull --prefix src/vitis --squash -m "pull subtree" "git@gitlab.veremes.net:Development/vitis_apps/sources/vitis.git" $vitisVersion
# fichiers à ignorer
git update-index --assume-unchanged conf/properties.json
git update-index --assume-unchanged conf/package.json
git update-index --assume-unchanged src/vitis/vas/rest/.htaccess
git update-index --assume-unchanged src/vitis/vas/rest/conf/properties.inc
git update-index --assume-unchanged src/vitis/vas/rest/conf/properties_domain.inc
git update-index --assume-unchanged src/vitis/vas/rest/conf/properties_post.inc
git update-index --assume-unchanged src/vitis/vas/rest/conf/properties_server.inc
git update-index --assume-unchanged src/vitis/vas/rest/conf/version.inc
# Modules # Modules
if [[ $depsCount > 0 ]]; then if [[ $depsCount > 0 ]]; then
...@@ -36,11 +26,7 @@ if [[ $depsCount > 0 ]]; then ...@@ -36,11 +26,7 @@ if [[ $depsCount > 0 ]]; then
echo "---- Pull ${aDeps[$i, name]} ----" echo "---- Pull ${aDeps[$i, name]} ----"
# Ajoute le dépôt # Ajoute le dépôt
git subtree pull --prefix src/${aDeps[$i, name]} --squash -m "pull subtree" "git@gitlab.veremes.net:Development/vitis_apps/sources/${aDeps[$i, name]}.git" master git subtree pull --prefix src/${aDeps[$i, name]} --squash -m "pull subtree" "git@gitlab.veremes.net:Development/vitis_apps/sources/${aDeps[$i, name]}.git" ${aDeps[$i, version]}
# fichiers à ignorer
git update-index --assume-unchanged src/${aDeps[$i, name]}/web_service/conf/properties.inc
git update-index --assume-unchanged src/${aDeps[$i, name]}/web_service/conf/properties_server.inc
git update-index --assume-unchanged src/${aDeps[$i, name]}/web_service/conf/version.inc
fi fi
done done
fi fi
...@@ -17,7 +17,11 @@ cd .. ...@@ -17,7 +17,11 @@ cd ..
# Vitis # Vitis
echo "---- Push vitis ----" echo "---- Push vitis ----"
git subtree push --prefix src/vitis "git@gitlab.veremes.net:Development/vitis_apps/sources/vitis.git" master { # 'try' block
git subtree push --prefix src/vitis "git@gitlab.veremes.net:Development/vitis_apps/sources/vitis.git" $vitisVersion
} || { # 'catch' block
echo "could not push vitis"
}
# Modules # Modules
if [[ $depsCount > 0 ]]; then if [[ $depsCount > 0 ]]; then
...@@ -28,7 +32,7 @@ if [[ $depsCount > 0 ]]; then ...@@ -28,7 +32,7 @@ if [[ $depsCount > 0 ]]; then
# Push le dépôt # Push le dépôt
{ # 'try' block { # 'try' block
git subtree push --prefix src/${aDeps[$i, name]} "git@gitlab.veremes.net:Development/vitis_apps/sources/${aDeps[$i, name]}.git" master git subtree push --prefix src/${aDeps[$i, name]} "git@gitlab.veremes.net:Development/vitis_apps/sources/${aDeps[$i, name]}.git" ${aDeps[$i, version]}
} || { # 'catch' block } || { # 'catch' block
echo "could not push ${aDeps[$i, name]}" echo "could not push ${aDeps[$i, name]}"
} }
......
@echo off
title Update Vitis tree
echo Update Vitis tree
setlocal EnableDelayedExpansion
cd utils
REM Pull repo
"C:\Program Files\Git\bin\sh.exe" --login -i -c "git pull"
REM Pull subtrees
"C:\Program Files\Git\bin\sh.exe" --login -i -c "./pull_subtrees.sh"
REM Save important files
if exist "../vas/rest/sql" (
robocopy "../vas/rest/sql" "../vas/rest/sql_bak" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "../vas/rest/conf" (
robocopy "../vas/rest/conf" "../vas/rest/conf_bak" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
REM Replace Vitis files
for /d %%g in ("../src/vitis/client/*") do (
set x=%%g
echo copy client/!x!
rmdir /S /Q "../client/!x!"
robocopy "../src/vitis/client/!x!" "../client/!x!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
for /d %%g in ("../src/vitis/vas/sql") do (
echo copy vas/sql
rmdir /S /Q "../vas/sql"
robocopy "../src/vitis/vas/sql" "../vas/sql" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
for /d %%g in ("../src/vitis/vas/rest/class") do (
echo copy vas/rest/class
rmdir /S /Q "../vas/rest/class"
robocopy "../src/vitis/vas/rest/class" "../vas/rest/class" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
for /d %%g in ("../src/vitis/vas/rest/conf") do (
echo copy vas/rest/conf
robocopy "../src/vitis/vas/rest/conf" "../vas/rest/conf_veremes" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
for /d %%g in ("../src/vitis/vas/rest/inc") do (
echo copy vas/rest/inc
rmdir /S /Q "../vas/rest/inc"
robocopy "../src/vitis/vas/rest/inc" "../vas/rest/inc" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
for /d %%g in ("../src/vitis/vas/rest/ws") do (
echo copy vas/rest/ws
rmdir /S /Q "../vas/rest/ws"
robocopy "../src/vitis/vas/rest/ws" "../vas/rest/ws" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
REM Replace modules files
for /d %%g in ("../src/module_*") do (
set x=%%g
if exist "../src/%%g/module" (
echo copy client/modules/!x:~7!
robocopy "../src/%%g/module" "../client/modules/!x:~7!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "../src/%%g/web_service/conf" (
echo copy vas/rest/conf_veremes/!x:~7!
robocopy "../src/%%g/web_service/conf" "../vas/rest/conf_veremes/!x:~7!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "../src/%%g/web_service/sql" (
echo copy vas/sql/!x:~7!
robocopy "../src/%%g/web_service/sql" "../vas/sql/!x:~7!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "../src/%%g/web_service/ws" (
echo copy vas/rest/ws/!x:~7!
robocopy "../src/%%g/web_service/ws" "../vas/rest/ws/!x:~7!" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
if exist "../src/%%g/web_service/class" (
echo copy vas/rest/class
robocopy "../src/%%g/web_service/class" "../vas/rest/class" /E /NFL /NDL /NJH /NJS /nc /ns /np
)
)
cd ..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment