Compare commits

...

1 Commits

Author SHA1 Message Date
Jan-Christoph Borchardt 84cee58ea1
Combine server & app update script into one file for simplicity
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
2019-11-30 18:00:49 +07:00
2 changed files with 22 additions and 4 deletions

View File

@ -6,9 +6,14 @@
# 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
# - changes to the master branch
# - removes local changes to package-lock.json to prevent conflicts
# - removes local built files js/appname.js & .map to prevent conflicts
# - pulls from master 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`)
#
# TODO: Currently the "xargs git branch -d" errors with "fatal: branch name required" if there are no branches to delete
# TODO: Do the build steps if they are consistent for the apps (like `npm run dev`)
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 ..' \;
find apps* -maxdepth 2 -name .git -exec sh -c 'cd {}/../ && printf "\n\033[1m${PWD##*/}\033[0m\n" && git checkout master && git checkout -- package-lock.json && git checkout -- js/$(printf "${PWD##*/}").js && git checkout -- js/$(printf "${PWD##*/}").js.map && 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 ..' \;

View File

@ -3,6 +3,19 @@
# For local development environment
# Use from Nextcloud server folder with `./build/update.sh`
# The command automatically:
# - updates the server
# - goes through all apps which are not shipped via server
# - shows the app name in bold and uses whitespace for separation
# - changes to the master branch
# - pulls from master quietly
# - shows the 3 most recent commits for context
# - removes branches merged into master
# TODO: Currently the "xargs git branch -d" errors with "fatal: branch name required" if there are no branches to delete
# TODO: Remove local changes to package-lock.json, js/appname.js & .map to prevent conflicts, but only if the file exists locally as otherwise the script stops
# TODO: Automatically build apps if possible, e.g. using `npm run dev`
# Update server
printf "\n\033[1m${PWD##*/}\033[0m\n"
git checkout master
@ -13,4 +26,4 @@ git branch --merged master | grep -v "master$" | xargs git branch -d
git submodule update --init
# Update apps
source ./build/update-apps.sh
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 ..' \;