add crontab, update git from several forges
This commit is contained in:
parent
dcfa20ea3f
commit
0ed6e08ab1
7
bash/crontab
Normal file
7
bash/crontab
Normal file
@ -0,0 +1,7 @@
|
||||
#
|
||||
# For more information see the manual pages of crontab(5) and cron(8)
|
||||
#
|
||||
# m h dom mon dow command
|
||||
*/5 * * * * cd ~/Nextcloud/textes/orgmode && git add . --all && git commit -m "update orgmode files from Spaceship" && cd -
|
||||
0 * * * * cd ~/Nextcloud/textes/orgmode && bash update_calendar.sh
|
||||
0 */4 * * * bash /home/tykayn/sync_spaceship.sh
|
@ -2,19 +2,23 @@
|
||||
# update all projects
|
||||
# list of framagit repos to clone
|
||||
|
||||
declare -a StringArray=("caisse-bliss" "duniter" "joinfediverse" "date-poll-api" "mastodon" "peertube" "events-liberator" "gitall" "dotclear-importer" "mobilizon" "fanzine-log" "crossed-words" "generator-tk" "circles" "card-deck" "sf-probe" "mastermind" "portfolio" "time-tracker" "cipherbliss" "caisse-bliss-frontend" "compta" "trafficjam" "ical-generator" "blueprint-cipherbliss" "dotclear2wordpress" "api" "diaspora" )
|
||||
declare -a StringArrayFramagit=("caisse-bliss" "joinfediverse" "date-poll-api" "mastodon" "peertube" "events-liberator" "gitall" "dotclear-importer" "mobilizon" "fanzine-log" "crossed-words" "generator-tk" "circles" "card-deck" "sf-probe" "mastermind" "portfolio" "time-tracker" "cipherbliss" "caisse-bliss-frontend" "compta" "trafficjam" "ical-generator" "blueprint-cipherbliss" "dotclear2wordpress" "api" "diaspora" )
|
||||
|
||||
declare -a StringArrayForgeChapril=("transcription" "org-report-stats" "multi-account-post-schedule-mastodon" "framalibre-scraping" "scripts" "melting-pot" "funky-framadate-front" "rss-feeder-mobilizon" "mastodon-archive-stats" "gtg2json" "libreavous-audio-reader" "osm_my_commerce" "fromage-js" "ueberauth_openstreetmap" "events-liberator")
|
||||
|
||||
prefix_framagit='https://framagit.org/tykayn/'
|
||||
username="${SUDO_USER:-${USER}}"
|
||||
cloning_place="/home/$username/www/"
|
||||
prefix_forgechapril='https://forge.chapril.org/tykayn/'
|
||||
|
||||
cloning_place="/home/$USER/www/"
|
||||
|
||||
mkdir -p $cloning_place
|
||||
|
||||
echo $cloning_place
|
||||
#mkdir $cloning_place
|
||||
cd $cloning_place
|
||||
git config --global credential.helper store
|
||||
|
||||
echo "Number of items in original list: ${#list[*]}"
|
||||
for folder_name in ${StringArray[@]}
|
||||
echo "cloning from framagit"
|
||||
|
||||
for folder_name in ${StringArrayFramagit[@]}
|
||||
do
|
||||
echo "check project ${folder_name}"
|
||||
if [ ! -d $folder_name ]
|
||||
@ -31,22 +35,27 @@ do
|
||||
|
||||
git remote -v
|
||||
git fetch origin
|
||||
# update dependencies if there is an update script
|
||||
if [ -f "update.sh" ]
|
||||
then
|
||||
echo "update.sh exists"
|
||||
# bash update.sh
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# done framagit
|
||||
|
||||
if [ -f "yarn.lock" ]
|
||||
then
|
||||
echo "installing yarn packages"
|
||||
# yarn install --pure-lockfile
|
||||
# elif [ -f "package.lock" ]
|
||||
# npm i
|
||||
fi
|
||||
for folder_name in ${StringArrayForgeChapril[@]}
|
||||
do
|
||||
echo "check project ${folder_name}"
|
||||
if [ ! -d $folder_name ]
|
||||
then
|
||||
echo "cloning ${folder_name}"
|
||||
git clone "${prefix_forgechapril}${folder_name}.git"
|
||||
|
||||
cd ..
|
||||
# test existence of a folder
|
||||
# if there is no folder, clone it
|
||||
# else, update with fetch from origin
|
||||
else
|
||||
echo "##### update project $folder_name"
|
||||
cd $folder_name
|
||||
|
||||
git remote -v
|
||||
git fetch origin
|
||||
fi
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user