diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh new file mode 100755 index 0000000..80c1d4e --- /dev/null +++ b/scripts/rebuild.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +rm -rf node_modules package-lock.json +npm i +npm run build +npm ci --only=production +git add node_modules package-lock.json lib diff --git a/scripts/update-dependencies.sh b/scripts/update-dependencies.sh new file mode 100755 index 0000000..a67fc3e --- /dev/null +++ b/scripts/update-dependencies.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# update dependencies + +DATE=$(date +"%Y%m%d") +BRANCH=feature/update-dependencies-${DATE} +COLOR_SUCCESS="\e[1;32m" +COLOR_RESET="\e[m" + +# create branch +git checkout development || exit 1 +git checkout -b ${BRANCH} || exit 1 + +# check updates +npm ci +npm run check-updates -- -u || exit 1 + +# re-install packages +rm -rf package-lock.json node_modules || exit 1 +npm i || exit 1 + +# build check +npm run build || exit 1 + +# commit +npm ci --only=production || exit 1 +git add package.json package-lock.json node_modules || exit 1 +git commit -m "update dependencies" || exit 1 + +# finished! +echo -e " +${COLOR_SUCCESS}πŸŽ‰All dependencies are updated successfully.πŸŽ‰${COLOR_RESET} + +Push changes and merge into 'develop' branch. + + git push --set-upstream origin ${BRANCH} +"