Browse Source

drone config and doc generation

master
nitowa 2 years ago
parent
commit
898cad5f55
4 changed files with 96 additions and 4 deletions
  1. 10
    2
      README.md
  2. 83
    0
      drone.yml
  3. 2
    1
      package.json
  4. 1
    1
      test/primitives.ts

+ 10
- 2
README.md View File

@@ -5,7 +5,7 @@
5 5
 [![Weekly Downloads](https://img.shields.io/npm/dw/xrpio?color=important)](https://www.npmjs.com/package/xrpio)
6 6
 [![License Type](https://img.shields.io/npm/l/xrpio?color=blueviolet)](https://gitea.nitowa.xyz/docs/xrpio/src/branch/master/LICENSE.md)
7 7
 
8
-xrpio is a library that allows you to write and read arbitrary data to the ripple blockchain.
8
+xrpio is a library that allows you to write and read arbitrary data in the ripple blockchain.
9 9
 
10 10
 # How to install
11 11
 ```
@@ -19,7 +19,15 @@ import {treeRead, treeWrite} from 'xrpio'
19 19
 const api = new RippleAPI({ server: "..." }) 
20 20
 await api.connect()
21 21
 
22
-const dataRootHash = await treeWrite(api, "Arbitrary string data 123", {address: "Sender address", secret: "Sender private key"}, "Receiver address")
22
+const dataRootHash = await treeWrite(
23
+    api, 
24
+    "Arbitrary string data 123", 
25
+    { 
26
+        address: "Sender address", 
27
+        secret: "Sender private key"
28
+    }, 
29
+    "Receiver address"
30
+)
23 31
 
24 32
 const data = await treeRead(api, [dataRootHash])
25 33
 console.log(data) //"Arbitrary string data 123"

+ 83
- 0
drone.yml View File

@@ -0,0 +1,83 @@
1
+---
2
+kind: pipeline
3
+type: docker
4
+name: default
5
+
6
+steps:
7
+
8
+- name: restore cache
9
+  image: drillster/drone-volume-cache
10
+  settings:
11
+    restore: true
12
+    mount:
13
+      - ./node_modules
14
+  volumes:
15
+  - name: cache
16
+    path: /cache
17
+
18
+- name: npm install
19
+  image: node:12
20
+  commands:
21
+  - npm install
22
+
23
+- name: npm run build
24
+  image: node:12
25
+  commands:
26
+  - npm run build
27
+
28
+- name: rebuild cache
29
+  image: drillster/drone-volume-cache
30
+  settings:
31
+    rebuild: true
32
+    mount:
33
+      - ./node_modules
34
+  volumes:
35
+  - name: cache
36
+    path: /cache
37
+
38
+- name: npm run test
39
+  image: node:12
40
+  commands:
41
+  - npm run test
42
+
43
+- name: build docs
44
+  image: node:12
45
+  commands:
46
+  - npm run docs
47
+  when:
48
+    event:
49
+      - tag
50
+
51
+- name: deliver docs
52
+  image: node:12
53
+  commands:
54
+  - echo ${DRONE_BUILD_CREATED}
55
+  - git clone https://gitea.nitowa.xyz/docs/${DRONE_REPO_NAME}.git; cd ${DRONE_REPO_NAME} && rm -rf ./*; cp -r ../docs/* .; cp ../LICENSE.md .
56
+  - sed -i '1,3d; $d' README.md && echo "### Version\n\n${DRONE_TAG}\n" >> ./README.md
57
+  - sed -i -e 1,4d ./globals.md && cat ./globals.md >> ./README.md
58
+  - git add --all; git -c user.email="${DRONE_COMMIT_AUTHOR_EMAIL}" -c user.name="${DRONE_COMMIT_AUTHOR}" commit --all --allow-empty --message "generated from tag ${DRONE_TAG}"
59
+  - (git tag ${DRONE_TAG} && git push --force origin master ${DRONE_TAG}) || true
60
+  environment:
61
+    GIT_USER:
62
+      from_secret: git_user
63
+    GIT_PASSWORD:
64
+      from_secret: git_password
65
+  when:
66
+    event:
67
+      - tag
68
+
69
+- name: npm publish
70
+  image: plugins/npm
71
+  settings:
72
+    username: nitowa
73
+    password:
74
+      from_secret: npm_password
75
+    email: peter.millauer@gmail.com
76
+  when:
77
+    event:
78
+      - tag
79
+
80
+volumes:
81
+- name: cache 
82
+  host:
83
+    path: /tmp

+ 2
- 1
package.json View File

@@ -13,7 +13,8 @@
13 13
     "webpack-gui": "webpack --config webpack.gui.js --progress && cp build/gui/main.js gui",
14 14
     "webpack-gateway": "webpack --config webpack.gateway.js --progress && cp build/gateway/main.js gateway",
15 15
     "test": "npm run build && mocha --bail=true ./lib/test/*.js",
16
-    "deploy": "node ./lib/Deploy.js"
16
+    "deploy": "node ./lib/Deploy.js",
17
+    "docs": "typedoc --out docs ./src --readme ./README.md --plugin typedoc-plugin-markdown --mode file --hideBreadcrumbs --hideSources"
17 18
   },
18 19
   "author": "nitowa",
19 20
   "license": "MIT",

+ 1
- 1
test/primitives.ts View File

@@ -60,7 +60,7 @@ describe('XRPIO', () => {
60 60
         let treeRoot
61 61
         it(`can tree write (${TEST_DATA.length} bytes)`, async function (){
62 62
             this.timeout(10000)
63
-            treeRoot = await treeWrite(api, TEST_DATA, sendWallet, receiveWallet.address)
63
+            treeRoot = await treeWrite(api, TEST_DATA, {address: "123", secret: "123"}, receiveWallet.address)
64 64
         })
65 65
     
66 66
         it('can tree read', async function() {

Loading…
Cancel
Save