1
0
Fork 0
mirror of https://github.com/shimataro/ssh-key-action.git synced 2025-06-19 22:52:10 +10:00

* refactor update-dependencies.sh

This commit is contained in:
shimataro 2020-01-23 23:19:24 +09:00
parent c597d321a2
commit c4fb5b5977
No known key found for this signature in database
GPG key ID: BE92C05736911A9D

View file

@ -1,30 +1,32 @@
#!/bin/bash
# update dependencies
set -e
DATE=$(date +"%Y%m%d")
BRANCH=feature/update-dependencies-${DATE}
COLOR_SUCCESS="\e[1;32m"
COLOR_RESET="\e[m"
# create branch
git checkout develop || exit 1
git checkout -b ${BRANCH} || exit 1
git checkout develop
git checkout -b ${BRANCH}
# check updates
npm ci
npm run check-updates -- -u || exit 1
npm run check-updates -- -u
# re-install packages
rm -rf package-lock.json node_modules || exit 1
npm i || exit 1
rm -rf package-lock.json node_modules
npm i
# build check
npm run build || exit 1
npm run build
# 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
npm ci --only=production
git add package.json package-lock.json node_modules
git commit -m "update dependencies"
# finished!
echo -e "