Browse Source

up script without temp file

master
Tykayn 2 months ago
committed by tykayn
parent
commit
84a7c55940
  1. 3
      monitoring/check_mobilizonchaprilorg_update
  2. 2
      rapport_activite/rapport_activite.sh
  3. 2
      upgrade/upgrade.sh

3
monitoring/check_mobilizonchaprilorg_update

@ -12,7 +12,6 @@
# project api for gitlab https://docs.gitlab.com/ee/api/tags.html
# upgrade documentation https://docs.joinmobilizon.org/administration/upgrading/
LOCAL_REPO=/srv/mobilizon.chapril.org/live
FRAMAGIT_PROJECT_ID=20125
function usage() {
@ -23,7 +22,7 @@ function usage() {
if [ "$#" -ne 0 ]; then
usage
else
lastVersion=$(curl -s https://framagit.org/api/v4/projects/$FRAMAGIT_PROJECT_ID/releases | jshon -a -e name > /tmp/listOfVersions.txt && sed -i -e "/rc/d" /tmp/listOfVersions.txt && cat /tmp/listOfVersions.txt |cut -d '"' -f2|grep -v '[\^\(alpha\)]'|head -n 1)
lastVersion=$(curl -s https://framagit.org/api/v4/projects/20125/releases | jshon -a -e name 2>/dev/null | sed -e "/rc/d" | cut -d '"' -f2 | grep -v '[\^\(alpha\)]'|head -n 1)
currentVersion=$(cd $LOCAL_REPO && git describe --exact-match --tags $(git log -n1 --pretty='%h') |cut -c 9-100 )
# le tag se nomme ainsi "chapril-1.0.2" donc pour comparer uniquement les numéros de version on enlève le début du nom

2
rapport_activite/rapport_activite.sh

@ -127,7 +127,7 @@ generateSpecificReport()
echo "Nombre de comptes selon l'api = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfUsers" -u)"
# décompte des profils
DAY_INTERVAL=300;
DAY_INTERVAL=30000;
profiles_all_time=$(sudo -u postgres -H -- psql -d mobilizon_prod -c "SELECT count(user_id) FROM actors WHERE type='Person' AND user_id is not null AND inserted_at >= ('now'::date - '$DAY_INTERVAL day'::interval )" -t | grep -v '^$' | awk '{print $1}' )
DAY_INTERVAL=30;
profiles_created_last_month=$(sudo -u postgres -H -- psql -d mobilizon_prod -c "SELECT count(user_id) FROM actors WHERE type='Person' AND user_id is not null AND inserted_at >= ('now'::date - '$DAY_INTERVAL day'::interval )" -t | grep -v '^$' | awk '{print $1}' )

2
upgrade/upgrade.sh

@ -12,7 +12,7 @@ echo " "
cd LOCAL_REPO
git fetch --tags
lastVersion=$(curl -s https://framagit.org/api/v4/projects/$FRAMAGIT_PROJECT_ID/releases | jshon -a -e name > /tmp/listOfVersions.txt && sed -i -e "/rc/d" /tmp/listOfVersions.txt && cat /tmp/listOfVersions.txt |cut -d '"' -f2|grep -v '[\^\(alpha\)]'|head -n 1)
lastVersion=$(curl -s https://framagit.org/api/v4/projects/20125/releases | jshon -a -e name 2>/dev/null | sed -e "/rc/d" | cut -d '"' -f2 | grep -v '[\^\(alpha\)]'|head -n 1)
currentVersion=$(cd $LOCAL_REPO && git branch | grep '*'|cut -c 3-100 )
if [ $currentVersion = $lastVersion ]; then
echo " "

Loading…
Cancel
Save