This commit is contained in:
wat
2019-09-22 13:04:50 +02:00
parent 0d98e74d19
commit fa4041f67c
+16 -16
View File
@@ -65,22 +65,22 @@ steps:
- name: versioning - name: versioning
image: node:12 image: node:12
commands: commands:
- git config --global user.email "frontwork.me@gmail.com" - git config --global user.email "frontwork.me@gmail.com"
- git config --global user.name "drone" - git config --global user.name "drone"
- export PACKAGE_VERSION $(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') - export PACKAGE_VERSION $(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
- export LATEST_VERSION $(npm view rpclibrary | grep latest | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') - export LATEST_VERSION $(npm view rpclibrary | grep latest | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
- >- if [ "${PACKAGE_VERSION}" != "${LATEST_VERSION}" ]; - >- if [ "${PACKAGE_VERSION}" != "${LATEST_VERSION}" ];
then then
git tag $PACKAGE_VERSION git tag $PACKAGE_VERSION
git status git status
git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-vendor/${DRONE_REPO_NAME}.git $PACKAGE_VERSION; git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-vendor/${DRONE_REPO_NAME}.git $PACKAGE_VERSION;
else else
echo 'Version: ' echo 'Version: '
echo $LATEST_VERSION echo $LATEST_VERSION
echo 'did not change. Don`t push tag to master'; echo 'did not change. Don`t push tag to master';
fi fi
- echo 'Package Version: '; echo ${PACKAGE_VERSION} - echo 'Package Version: '; echo ${PACKAGE_VERSION}
- echo 'Latest Version: '; echo ${LATEST_VERSION} - echo 'Latest Version: '; echo ${LATEST_VERSION}
environment: environment:
GIT_USER: GIT_USER:
from_secret: git_user from_secret: git_user