From 9f4ae034c1c28b803d246595ce409b6492b07bd1 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 10 May 2019 14:18:12 +0200 Subject: [PATCH 1/6] Add script to update Nextcloud apps from latest git master, ref #15145 Signed-off-by: Jan-Christoph Borchardt --- build/update-apps.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 build/update-apps.sh diff --git a/build/update-apps.sh b/build/update-apps.sh new file mode 100755 index 00000000000..03fff70a3a6 --- /dev/null +++ b/build/update-apps.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Update Nextcloud apps from latest git master +# For local development environment +# Use from Nextcloud server folder with `./build/update-apps.sh` +# +# It automatically: +# - goes through all apps which are not shipped via server +# - shows the app name in bold and uses whitespace for separation +# - changes to master and pulls quietly +# - shows the 3 most recent commits for context +# - removes branches merged into master +# - … could even do the build steps if they are consistent for the apps (like `make`) + +find apps* -maxdepth 2 -name .git -exec sh -c 'cd {}/../ && printf "\n\033[1m${PWD##*/}\033[0m\n" && git checkout master && git pull --quiet && git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" && printf "\n" && git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d && git fetch --prune --quiet && cd ..' \; From b403d72f518dd47d1fcd0ee18bc1475bbfadbd32 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 10 May 2019 14:59:08 +0200 Subject: [PATCH 2/6] Also add script to update both server and apps Signed-off-by: Jan-Christoph Borchardt --- build/update.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 build/update.sh diff --git a/build/update.sh b/build/update.sh new file mode 100755 index 00000000000..cf1ae9103e4 --- /dev/null +++ b/build/update.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Update Nextcloud server and apps from latest git master +# For local development environment +# Use from Nextcloud server folder with `./build/update.sh` + +# Update server +printf "\n\033[1m${PWD##*/}\033[0m\n" +git checkout master +git pull --quiet +git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" +printf "\n" +git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d +git fetch --prune --quiet +git submodule update + +# Update apps +source ./build/update-apps.sh From 934924577a13e95f688f222e3cf59687f74a8ab8 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 10 May 2019 15:05:38 +0200 Subject: [PATCH 3/6] Fix for update script when submodule is not initialized Signed-off-by: Jan-Christoph Borchardt --- build/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/update.sh b/build/update.sh index cf1ae9103e4..8c52ea7a799 100755 --- a/build/update.sh +++ b/build/update.sh @@ -11,7 +11,7 @@ git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" printf "\n" git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d git fetch --prune --quiet -git submodule update +git submodule update --init # Update apps source ./build/update-apps.sh From bc61b15e2f4f724d68dfed1a0ad0707b5266faef Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 14 May 2019 15:08:38 +0200 Subject: [PATCH 4/6] Adjust script to remove branches which are deleted on GitHub Co-Authored-By: Morris Jobke --- build/update-apps.sh | 2 +- build/update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/update-apps.sh b/build/update-apps.sh index 03fff70a3a6..f2f2810c24f 100755 --- a/build/update-apps.sh +++ b/build/update-apps.sh @@ -11,4 +11,4 @@ # - removes branches merged into master # - … could even do the build steps if they are consistent for the apps (like `make`) -find apps* -maxdepth 2 -name .git -exec sh -c 'cd {}/../ && printf "\n\033[1m${PWD##*/}\033[0m\n" && git checkout master && git pull --quiet && git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" && printf "\n" && git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d && git fetch --prune --quiet && cd ..' \; +find apps* -maxdepth 2 -name .git -exec sh -c 'cd {}/../ && printf "\n\033[1m${PWD##*/}\033[0m\n" && git checkout master && git pull --quiet -p && git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" && printf "\n" && git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d && git fetch --prune --quiet && cd ..' \; diff --git a/build/update.sh b/build/update.sh index 8c52ea7a799..99961550119 100755 --- a/build/update.sh +++ b/build/update.sh @@ -6,7 +6,7 @@ # Update server printf "\n\033[1m${PWD##*/}\033[0m\n" git checkout master -git pull --quiet +git pull --quiet -p git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" printf "\n" git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d From 8f0656aae9dabc256752914aa78761ea72fca575 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 15 May 2019 12:38:53 +0200 Subject: [PATCH 5/6] Remove eduplicate git fetch from update scripts Signed-off-by: Jan-Christoph Borchardt --- build/update-apps.sh | 2 +- build/update.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/build/update-apps.sh b/build/update-apps.sh index f2f2810c24f..060cfe0fdca 100755 --- a/build/update-apps.sh +++ b/build/update-apps.sh @@ -11,4 +11,4 @@ # - removes branches merged into master # - … could even do the build steps if they are consistent for the apps (like `make`) -find apps* -maxdepth 2 -name .git -exec sh -c 'cd {}/../ && printf "\n\033[1m${PWD##*/}\033[0m\n" && git checkout master && git pull --quiet -p && git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" && printf "\n" && git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d && git fetch --prune --quiet && cd ..' \; +find apps* -maxdepth 2 -name .git -exec sh -c 'cd {}/../ && printf "\n\033[1m${PWD##*/}\033[0m\n" && git checkout master && git pull --quiet -p && git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" && printf "\n" && git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d && cd ..' \; diff --git a/build/update.sh b/build/update.sh index 99961550119..ef4c7e3b76b 100755 --- a/build/update.sh +++ b/build/update.sh @@ -10,7 +10,6 @@ git pull --quiet -p git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" printf "\n" git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d -git fetch --prune --quiet git submodule update --init # Update apps From fa066da77c7d56939ec1a73675c358cb782a56c6 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Fri, 17 May 2019 22:49:33 +0200 Subject: [PATCH 6/6] Fix app update script for macOS Signed-off-by: Jan-Christoph Borchardt --- build/update-apps.sh | 2 +- build/update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/update-apps.sh b/build/update-apps.sh index 060cfe0fdca..e4611a79aff 100755 --- a/build/update-apps.sh +++ b/build/update-apps.sh @@ -11,4 +11,4 @@ # - removes branches merged into master # - … could even do the build steps if they are consistent for the apps (like `make`) -find apps* -maxdepth 2 -name .git -exec sh -c 'cd {}/../ && printf "\n\033[1m${PWD##*/}\033[0m\n" && git checkout master && git pull --quiet -p && git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" && printf "\n" && git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d && cd ..' \; +find apps* -maxdepth 2 -name .git -exec sh -c 'cd {}/../ && printf "\n\033[1m${PWD##*/}\033[0m\n" && git checkout master && git pull --quiet -p && git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" && printf "\n" && git branch --merged master | grep -v "master$" | xargs git branch -d && cd ..' \; diff --git a/build/update.sh b/build/update.sh index ef4c7e3b76b..3a3d2eac5dc 100755 --- a/build/update.sh +++ b/build/update.sh @@ -9,7 +9,7 @@ git checkout master git pull --quiet -p git --no-pager log -3 --pretty=format:"%h %Cblue%ar%x09%an %Creset%s" printf "\n" -git branch --merged master | grep -v "master$" | xargs --no-run-if-empty git branch -d +git branch --merged master | grep -v "master$" | xargs git branch -d git submodule update --init # Update apps