mobile_tele2med_2024/upload.sh.bak
2024-04-09 16:57:26 +03:00

44 lines
3.7 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
client="mobile_tele2med"
curl --data-urlencode "task=get_new_ver" --data-urlencode "source=Frontend" --data-urlencode "key=IDDQD" --data-urlencode "client=$client" --data-urlencode "type=revision" --data-urlencode "comment=$1" "https://devweb.tele2med.ru/SoftwareVersion/index.php"
eval "$(ssh-agent)"
ssh-add "C:\Users\sag-a\.ssh\id_rsa"
git add .
git commit -m "$1"
git push
curl -o conf.ini "https://devweb.tele2med.ru/SoftwareVersion/index.php?task=get_last_build_new&source=Frontend&key=IDDQD&client=$client"
readarray -t array <<< "$(cat './conf.ini')"
#echo ${array[*]} 'Все записи в массиве'
#echo ${!array[*]} 'Все индексы в массиве'
#echo ${#array[*]} 'Количество записей в массиве'
#echo ${#array[0]} 'Длина первой записи (нумерация с нуля)'
splash_version=$(echo ${array[0]}|tr -d '\n\r')
splash_subname=$(echo ${array[1]}|tr -d '\n\r')
splash_name=$(echo ${array[2]}|tr -d '\n\r')
splash_date=$(echo ${array[3]}|tr -d '\n\r')
splash_date2=$(echo ${array[4]}|tr -d '\n\r')
splash_comment=$(echo ${array[5]}|tr -d '\n\r')
sed -i -e "/^ <string name\=\"splash_version\">/s/=.*/=\"splash_version\">$splash_version<\/string>/" './app/src/main/res/values/strings.xml'
sed -i -e "/^ <string name\=\"splash_version\">/s/=.*/=\"splash_version\">$splash_version<\/string>/" './app/src/montrans/res/values/strings.xml'
sed -i -e "/^ <string name\=\"splash_version\">/s/=.*/=\"splash_version\">$splash_version<\/string>/" './app/src/tis/res/values/strings.xml'
#sed -i -e "/^ <string name\=\"splash_subname\">/s/=.*/=\"splash_subname\">$splash_subname<\/string>/" './app/src/main/res/values/strings.xml'
#sed -i -e "/^ <string name\=\"splash_name\">/s/=.*/=\"splash_name\">$splash_name<\/string>/" './app/src/main/res/values/strings.xml'
sed -i -e "/^ <string name\=\"splash_date\">/s/=.*/=\"splash_date\">$splash_date<\/string>/" './app/src/main/res/values/strings.xml'
sed -i -e "/^ <string name\=\"splash_comment\">/s/=.*/=\"splash_comment\">$splash_comment<\/string>/" './app/src/main/res/values/strings.xml'
sed -i -e "/^ def splash_date =/s/=.*/= \"${splash_date2}\"/" './app/build.gradle'
sed -i -e "/^ def splash_version =/s/=.*/= \"${splash_version}\"/" './app/build.gradle'
#sed -i -e "/^ <string name\=\"splash_subname\">/s/=.*/=\"splash_subname\">$splash_subname<\/string>/" './app/src/montrans/res/values/strings.xml'
#sed -i -e "/^ <string name\=\"splash_name\">/s/=.*/=\"splash_name\">$splash_name<\/string>/" './app/src/montrans/res/values/strings.xml'
sed -i -e "/^ <string name\=\"splash_date\">/s/=.*/=\"splash_date\">$splash_date<\/string>/" './app/src/montrans/res/values/strings.xml'
sed -i -e "/^ <string name\=\"splash_comment\">/s/=.*/=\"splash_comment\">$splash_comment<\/string>/" './app/src/montrans/res/values/strings.xml'
sed -i -e "/^ def splash_date =/s/=.*/= \"${splash_date2}\"/" './app/build.gradle'
sed -i -e "/^ def splash_version =/s/=.*/= \"${splash_version}\"/" './app/build.gradle'
#sed -i -e "/^ <string name\=\"splash_subname\">/s/=.*/=\"splash_subname\">$splash_subname<\/string>/" './app/src/tis/res/values/strings.xml'
#sed -i -e "/^ <string name\=\"splash_name\">/s/=.*/=\"splash_name\">$splash_name<\/string>/" './app/src/tis/res/values/strings.xml'
sed -i -e "/^ <string name\=\"splash_date\">/s/=.*/=\"splash_date\">$splash_date<\/string>/" './app/src/tis/res/values/strings.xml'
sed -i -e "/^ <string name\=\"splash_comment\">/s/=.*/=\"splash_comment\">$splash_comment<\/string>/" './app/src/tis/res/values/strings.xml'
sed -i -e "/^ def splash_date =/s/=.*/= \"${splash_date2}\"/" './app/build.gradle'
sed -i -e "/^ def splash_version =/s/=.*/= \"${splash_version}\"/" './app/build.gradle'