33build the binary on mac
44
55``` sh
6- rm -rf build
76yarn
87```
98
10- # 1 build the docker image
11-
12- run ` docker-compose build `
13-
14- # 2 start the server
9+ # 1 build and run the docker image
1510
1611``` sh
17- docker run -d \
18- -it \
19- --name build_pg_query \
12+ docker run \
2013 --mount type=bind,source=" $( pwd) " /libpg_query,target=/pg_query \
21- pyramation/libpg_query
14+ --rm -it \
15+ $( docker build -q --file docker/Dockerfile .)
2216```
2317
24- # 3 jump inside
25-
26- ` ssh ` into the box
18+ # build inside the docker image
2719
2820``` sh
29- docker exec -it build_pg_query /bin/bash
21+ branch=15-latest
22+ mkdir git_clone_dir && cd git_clone_dir
23+ git clone -b $branch --single-branch https://github.com/launchql/libpg-query-node
24+ cd libpg-query-node/
25+ yarn
26+
27+ # get the linux version and sent it to docker host
28+ cp ./libpg_query/linux/libpg_query.a /pg_query/linux/
3029```
3130
32- # publishing from inside
31+ Now on the docker host machine, you should be able to publish:
3332
3433``` sh
35- rm -rf git && mkdir git && cd git && git clone -b v15 --single-branch https://github.com/pyramation/libpg-query-node && cd libpg-query-node/ && yarn
36-
37- # get the OSX version you build before...
38- cp /pg_query/osx/libpg_query.a ./libpg_query/osx/
39-
40- # add your creds real quick... (look in your ~/.npmrc)
41- vi .npmrc
42- vi package.json
4334npm publish
4435```
4536
4637# building libpg_query
4738
48- not necessary, but for fun:
39+ to build manually using ` libpg_query `
4940
5041``` sh
5142mkdir git
5243cd git/
53- git clone git clone
[email protected] :pganalyze/libpg_query.git
54- git clone
[email protected] :pganalyze/libpg_query.git
5544git clone https://github.com/pganalyze/libpg_query.git
5645cd libpg_query/
5746make
@@ -61,18 +50,17 @@ cp libpg_query.a /pg_query/linux/
6150you should see ` .a ` files now :)
6251
6352```
64- libpg_query/
65- libpg_query//osx
66- libpg_query//osx/libpg_query.a
67- libpg_query//osx/.gitkeep
68- libpg_query//include
69- libpg_query//include/.gitkeep
70- libpg_query//include/pg_query.h
71- libpg_query//linux
72- libpg_query//linux/libpg_query.a
73- libpg_query//linux/.gitkeep
74- libpg_query//windows
75- libpg_query//windows/.gitkeep
53+ libpg_query/osx
54+ libpg_query/osx/libpg_query.a
55+ libpg_query/osx/.gitkeep
56+ libpg_query/include
57+ libpg_query/include/.gitkeep
58+ libpg_query/include/pg_query.h
59+ libpg_query/linux
60+ libpg_query/linux/libpg_query.a
61+ libpg_query/linux/.gitkeep
62+ libpg_query/windows
63+ libpg_query/windows/.gitkeep
7664```
7765
78- make sure you grab the ` pg_query.h ` if you don't have it ;)
66+ make sure you grab the ` pg_query.h ` if you don't have it ;)
0 commit comments