This commit is contained in:
wat
2019-09-22 13:45:04 +02:00
parent 6edc9c22f4
commit 74c927efab
+4 -4
View File
@@ -6,8 +6,8 @@ steps:
- name: versioning - name: versioning
image: node:12 image: node:12
commands: commands:
- export PACKAGE_VERSION=$(cat ./package.json | grep version | head -1 | awk -F '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') - 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:]]') - LATEST_VERSION=$(npm view rpclibrary | grep latest | head -1 | awk -F '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
- echo "${PACKAGE_VERSION}" - echo "${PACKAGE_VERSION}"
- echo "${LATEST_VERSION}" - echo "${LATEST_VERSION}"
- echo "${DRONE_BUILD_CREATED}" - echo "${DRONE_BUILD_CREATED}"
@@ -15,12 +15,12 @@ steps:
- git config --global user.name "${DRONE_COMMIT_AUTHOR}" - git config --global user.name "${DRONE_COMMIT_AUTHOR}"
- 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