Daniel Hübleitner преди 5 години
родител
ревизия
2f8d1dc14b
променени са 1 файла, в които са добавени 18 реда и са изтрити 0 реда
  1. 18
    0
      .drone.yml

+ 18
- 0
.drone.yml Целия файл

@@ -67,6 +67,24 @@ steps:
67 67
   commands:
68 68
   - git config --global user.email "frontwork.me@gmail.com"
69 69
   - git config --global user.name "drone"
70
+
71
+  // I have no Idea why not to do this like i did
72
+  - PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
73
+  - LATEST_VERSION=$(npm view rpclibrary | grep latest | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
74
+    - if [ "${PACKAGE_VERSION}" != "${LATEST_VERSION}" ]; 
75
+      then 
76
+        git tag $PACKAGE_VERSION
77
+        git status
78
+        git push https://$GIT_USER:$GIT_PASSWORD@gitea.frontblock.me/fw-vendor/${DRONE_REPO_NAME}.git master $PACKAGE_VERSION; 
79
+      else 
80
+        echo 'Version: '
81
+        echo $LATEST_VERSION 
82
+        echo 'did not change. Don`t push tag to master'; 
83
+    fi
84
+  - echo 'Package Version: '; echo ${PACKAGE_VERSION}
85
+  - echo 'Latest Version: '; echo ${LATEST_VERSION}
86
+
87
+
70 88
   environment:
71 89
     GIT_USER:
72 90
       from_secret: git_user

Loading…
Отказ
Запис