|
@@ -6,23 +6,12 @@ steps:
|
6
|
6
|
- name: versioning
|
7
|
7
|
image: node:12
|
8
|
8
|
commands:
|
9
|
|
- - export PACKAGE_VERSION=$(cat ./package.json | grep version | head -1 | awk -F '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
|
10
|
|
- - export LATEST_VERSION=$(npm view rpclibrary | grep latest | head -1 | awk -F '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
|
11
|
|
- - echo $PACKAGE_VERSION
|
12
|
|
- - echo $LATEST_VERSION
|
13
|
9
|
- echo $DRONE_BUILD_CREATED
|
14
|
10
|
- git config --global user.email "${DRONE_COMMIT_AUTHOR_EMAIL}"
|
15
|
11
|
- git config --global user.name "${DRONE_COMMIT_AUTHOR}"
|
16
|
|
- - if [ "${PACKAGE_VERSION}" != "${LATEST_VERSION}" ]; \
|
17
|
|
- then \
|
18
|
|
- git tag "$PACKAGE_VERSION" \
|
19
|
|
- git status \
|
20
|
|
- git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-vendor/${DRONE_REPO_NAME}.git $PACKAGE_VERSION \
|
21
|
|
- else \
|
22
|
|
- echo 'Version ' \
|
23
|
|
- echo "$LATEST_VERSION" \
|
24
|
|
- echo 'did not change. Don`t push tag to master' \
|
25
|
|
- fi
|
|
12
|
+ - git commit -A -m "Drone tagged as ${DRONE_TAG}"
|
|
13
|
+ - git tag "${DRONE_TAG}"
|
|
14
|
+ - git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-docs/${DRONE_REPO_NAME}.git master ${DRONE_TAG}
|
26
|
15
|
|
27
|
16
|
environment:
|
28
|
17
|
GIT_USER:
|