This commit is contained in:
wat
2019-09-22 13:32:00 +02:00
parent b565f4f4b7
commit 7de5293d41
+32 -32
View File
@@ -1,6 +1,38 @@
kind: pipeline
name: default
- name: versioning
image: node:12
commands:
- git config --global user.email "frontwork.me@gmail.com"
- git config --global user.name "drone"
- >
if [ "${PACKAGE_VERSION}" != "${LATEST_VERSION}" ];
then
git tag $PACKAGE_VERSION
git status
git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-vendor/${DRONE_REPO_NAME}.git $PACKAGE_VERSION;
else
echo 'Version '
echo $LATEST_VERSION
echo 'did not change. Don`t push tag to master';
fi
- echo "${PACKAGE_VERSION}"
- echo "${LATEST_VERSION}"
environment:
LATEST_VERSION:
$(npm view rpclibrary | grep latest | 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:]]')
GIT_USER:
from_secret: git_user
GIT_PASSWORD:
from_secret: git_password
trigger:
event:
exclude:
- tag
steps:
- name: restore cache
image: drillster/drone-volume-cache
@@ -62,38 +94,6 @@ steps:
event:
- tag
- name: versioning
image: node:12
commands:
- git config --global user.email "frontwork.me@gmail.com"
- git config --global user.name "drone"
- >
if [ "${PACKAGE_VERSION}" != "${LATEST_VERSION}" ];
then
git tag $PACKAGE_VERSION
git status
git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-vendor/${DRONE_REPO_NAME}.git $PACKAGE_VERSION;
else
echo 'Version '
echo $LATEST_VERSION
echo 'did not change. Don`t push tag to master';
fi
- echo "${PACKAGE_VERSION}"
- echo "${LATEST_VERSION}"
environment:
LATEST_VERSION:
$(npm view rpclibrary | grep latest | 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:]]')
GIT_USER:
from_secret: git_user
GIT_PASSWORD:
from_secret: git_password
trigger:
event:
exclude:
- tag
- name: commit documentation
image: node:12
commands: